-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(verification): add verification process anf pages
- Loading branch information
1 parent
32fb06c
commit 8336120
Showing
11 changed files
with
178 additions
and
25 deletions.
There are no files selected for viewing
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
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
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
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,45 @@ | ||
<app-toolbar> | ||
<ng-container ngProjectAs="left-actions"> | ||
<app-button-icon icon="arrow_back" routerLink="/"></app-button-icon> | ||
</ng-container> | ||
</app-toolbar> | ||
<div class="retro-content"> | ||
@if(token && verificationDone()) { | ||
<div class="retro-placeholder-image"> | ||
<img src="assets/icons/verified.svg" alt="mail sent icon" /> | ||
</div> | ||
<div class="retro-title placeholder">Profile verified</div> | ||
<div class="retro-text placeholder"> | ||
Thank you for completing the verification process! | ||
</div> | ||
<div class="retro-text placeholder"> | ||
Welcome to the mountains, you’re now officially a RetroSki community | ||
rider! Enjoy online adventures and connect with your friends. | ||
</div> | ||
<div class="retro-text placeholder"> | ||
Start your online riding experience by joining your friends on their | ||
servers. Or take your experience to the next level by | ||
<a class="retro-link" routerLink="/profile" | ||
>upgrading to a premium profile</a | ||
> | ||
to create your own servers, host events, and design custom tracks. | ||
</div> | ||
<button class="retro-button placeholder tertiary" routerLink="/login"> | ||
Ride online | ||
</button> | ||
} @else { | ||
<div class="retro-placeholder-image"> | ||
<img src="assets/icons/safety_check.svg" alt="mail sent icon" /> | ||
</div> | ||
<div class="retro-title placeholder">Almost there!</div> | ||
<div class="retro-text placeholder"> | ||
Thank you for joining the RetroSki online community! We’re thrilled to | ||
have you on board. | ||
</div> | ||
<div class="retro-text placeholder"> | ||
A verification email has been sent to your inbox. Please check your | ||
email and click the verification button to activate your account. Once | ||
verified, you’ll be ready to hit the slopes and ride with us! | ||
</div> | ||
} | ||
</div> |
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 @@ | ||
:host { | ||
display: flex; | ||
flex: 1 1 auto; | ||
flex-direction: column; | ||
padding: 1rem; | ||
} |
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,30 @@ | ||
import { ChangeDetectionStrategy, Component, inject, signal } from '@angular/core'; | ||
import { ButtonIconComponent } from '../../common/components/button-icon/button-icon.component'; | ||
import { ToolbarComponent } from '../../common/components/toolbar/toolbar.component'; | ||
import { ActivatedRoute, RouterLink } from '@angular/router'; | ||
import { AuthService } from '../../common/services/auth.service'; | ||
import { from, type Observable, of } from 'rxjs'; | ||
import { toSignal } from '@angular/core/rxjs-interop'; | ||
import type { User } from '../../common/models/user'; | ||
|
||
@Component({ | ||
selector: 'app-verification', | ||
imports: [ButtonIconComponent, RouterLink, ToolbarComponent], | ||
templateUrl: './verification.component.html', | ||
styleUrl: './verification.component.scss', | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
}) | ||
export class VerificationComponent { | ||
private route = inject(ActivatedRoute); | ||
private authService = inject(AuthService); | ||
|
||
protected readonly token = (this.route.snapshot.params as { token: string }).token; | ||
protected verificationDone = toSignal(this.verifyToken(this.token)); | ||
|
||
private verifyToken(token: string): Observable<boolean> { | ||
if (token) { | ||
return from(this.authService.verifyUser(token)); | ||
} | ||
return of(false); | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.