-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c301ff8
commit 63b3438
Showing
20 changed files
with
266 additions
and
21 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
7 changes: 7 additions & 0 deletions
7
src/app/components/oauth/login-failure/login-failure.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<!-- src/app/login-failure/login-failure.component.html --> | ||
<div class="login-failure"> | ||
<h1>Login Failed</h1> | ||
<p>Oops! Something went wrong with your login attempt.</p> | ||
<a href="/authentication/login">Try again</a> | ||
<!-- Provide a link to retry login or to contact support --> | ||
</div> |
21 changes: 21 additions & 0 deletions
21
src/app/components/oauth/login-failure/login-failure.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { LoginFailureComponent } from './login-failure.component'; | ||
|
||
describe('LoginFailureComponent', () => { | ||
let component: LoginFailureComponent; | ||
let fixture: ComponentFixture<LoginFailureComponent>; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [LoginFailureComponent] | ||
}); | ||
fixture = TestBed.createComponent(LoginFailureComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
18 changes: 18 additions & 0 deletions
18
src/app/components/oauth/login-failure/login-failure.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-login-failure', | ||
templateUrl: './login-failure.component.html', | ||
styleUrls: ['./login-failure.component.css'] | ||
}) | ||
export class LoginFailureComponent implements OnInit { | ||
|
||
constructor() { } | ||
|
||
ngOnInit(): void { | ||
// Here you can access the query parameters from the URL to display error messages | ||
// You might also provide options to retry the login or contact support | ||
console.log('Login failure page loaded'); | ||
} | ||
|
||
} |
Empty file.
6 changes: 6 additions & 0 deletions
6
src/app/components/oauth/login-success/login-success.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<!-- src/app/login-success/login-success.component.html --> | ||
<div class="login-success"> | ||
<h1>Login Successful</h1> | ||
<p>Welcome back! You have successfully logged in.</p> | ||
<!-- Add any additional information or links the user might need --> | ||
</div> |
21 changes: 21 additions & 0 deletions
21
src/app/components/oauth/login-success/login-success.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { LoginSuccessComponent } from './login-success.component'; | ||
|
||
describe('LoginSuccessComponent', () => { | ||
let component: LoginSuccessComponent; | ||
let fixture: ComponentFixture<LoginSuccessComponent>; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [LoginSuccessComponent] | ||
}); | ||
fixture = TestBed.createComponent(LoginSuccessComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
18 changes: 18 additions & 0 deletions
18
src/app/components/oauth/login-success/login-success.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-login-success', | ||
templateUrl: './login-success.component.html', | ||
styleUrls: ['./login-success.component.css'] | ||
}) | ||
export class LoginSuccessComponent implements OnInit { | ||
|
||
constructor() { } | ||
|
||
ngOnInit(): void { | ||
// You can access the query parameters from the URL here and perform actions accordingly | ||
// For example, you might want to store an authentication token, redirect to a dashboard, etc. | ||
console.log('Login success page loaded'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
src/app/components/oauth/oauth-button/oauth-button.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
a.btn-oauth { | ||
display: inline-block; | ||
width: 80px; /* Fixed width */ | ||
height: 30px; /* Fixed height */ | ||
line-height: 50px; /* Center the text vertically */ | ||
margin: 0.5rem; | ||
padding: 0 1rem; /* Adjust horizontal padding as needed */ | ||
text-align: center; | ||
border-radius: 0.25rem; | ||
font-size: 1rem; | ||
transition: transform 0.3s ease; | ||
box-shadow: 0 2px 4px 0 rgba(0,0,0,0.2); /* Optional: adds a shadow for depth */ | ||
} | ||
|
||
a.btn-oauth:hover { | ||
transform: translateY(-3px); | ||
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2); /* Optional: more pronounced shadow on hover */ | ||
} | ||
a.btn-oauth.btn-google { | ||
background-color: #db4437; /* Google's brand color */ | ||
color: #fff; | ||
} | ||
|
||
a.btn-oauth.btn-google:hover { | ||
background-color: #c1351d; /* A darker shade of Google's brand color for hover effect */ | ||
} | ||
|
||
a.btn-oauth.btn-github { | ||
background-color: #333; | ||
color: #fff; | ||
} | ||
|
||
a.btn-oauth.btn-github:hover { | ||
background-color: #1a1a1a; /* Darkened #333 by 5% */ | ||
} | ||
|
||
a.btn-oauth.btn-linkedin { | ||
background-color: #0077b5; | ||
color: #fff; | ||
} | ||
|
||
a.btn-oauth.btn-linkedin:hover { | ||
background-color: #006699; /* Darkened #0077b5 by 5% */ | ||
} | ||
|
||
/* Add more styles for other services as needed */ | ||
|
||
a.btn-oauth i { | ||
margin-right: 8px; /* Space between icon and text */ | ||
} | ||
|
||
a.btn-oauth i { | ||
margin-right: 8px; /* Space between icon and text */ | ||
font-size: 0.5rem; /* Halve the size of the icon */ | ||
} | ||
|
||
a.btn-oauth .fa { | ||
margin-right: 8px; /* Space between icon and text */ | ||
font-size: 0.5rem; /* Halve the size of the icon */ | ||
} |
3 changes: 3 additions & 0 deletions
3
src/app/components/oauth/oauth-button/oauth-button.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<a [@pulse] class="btn btn-outline-{{ service.toLowerCase() }}" href="/authentication/{{ service.toLowerCase() }}" (click)="login()" role="button"> | ||
<i class="{{ iconClass }}"></i> {{ service }} | ||
</a> |
21 changes: 21 additions & 0 deletions
21
src/app/components/oauth/oauth-button/oauth-button.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { OauthButtonComponent } from './oauth-button.component'; | ||
|
||
describe('OauthButtonComponent', () => { | ||
let component: OauthButtonComponent; | ||
let fixture: ComponentFixture<OauthButtonComponent>; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [OauthButtonComponent] | ||
}); | ||
fixture = TestBed.createComponent(OauthButtonComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
25 changes: 25 additions & 0 deletions
25
src/app/components/oauth/oauth-button/oauth-button.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Component, EventEmitter, HostBinding, Input, Output } from '@angular/core'; | ||
import { trigger, transition, useAnimation } from '@angular/animations'; | ||
import { pulse } from 'ng-animate'; | ||
|
||
@Component({ | ||
selector: 'app-oauth-button', | ||
templateUrl: './oauth-button.component.html', | ||
styleUrls: ['./oauth-button.component.css'], | ||
animations: [ | ||
trigger('pulse', [ | ||
transition(':enter', useAnimation(pulse, { params: { timing: 1 } })), | ||
]) | ||
] | ||
}) | ||
export class OauthButtonComponent { | ||
@Input() service = ''; | ||
@Input() iconClass = ''; | ||
@HostBinding('@pulse') pulse = true; | ||
@Output() loginRequested = new EventEmitter<string>(); | ||
|
||
public login(): void { | ||
console.log('Login requested for ' + this.service); | ||
this.loginRequested.emit(this.service); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
import { Component } from '@angular/core'; | ||
import { AuthService } from 'src/app/guards/auth/auth.service'; | ||
|
||
@Component({ | ||
selector: 'app-oauth', | ||
templateUrl: './oauth.component.html', | ||
styleUrls: ['./oauth.component.css'] | ||
}) | ||
export class OauthComponent { | ||
|
||
constructor(private authService: AuthService) {} | ||
public handleLoginRequest(service: string): void { | ||
console.log(`Login requested for: ${service}`); | ||
this.authService.loginWithOAuth(service); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters