-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: christophenne <christoph.enne@glasskube.eu>
- Loading branch information
1 parent
cf17cb3
commit e78be22
Showing
18 changed files
with
236 additions
and
47 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
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,20 @@ | ||
<section class="bg-gray-50 dark:bg-gray-900"> | ||
<div class="flex flex-col items-center justify-center px-6 py-8 mx-auto md:h-screen lg:py-0"> | ||
<a href="#" class="flex items-center mb-6 text-2xl font-semibold text-gray-900 dark:text-white"> | ||
<img class="w-8 h-8 mr-2" src="glasskube-logo.svg" alt="Glasskube" /> | ||
Glasskube | ||
</a> | ||
<div | ||
class="w-full bg-white rounded-lg shadow dark:border md:mt-0 sm:max-w-md xl:p-0 dark:bg-gray-800 dark:border-gray-700"> | ||
<div class="p-6 space-y-4 md:space-y-6 sm:p-8"> | ||
<h1 | ||
class="text-xl text-center font-bold leading-tight tracking-tight text-gray-900 md:text-2xl dark:text-white"> | ||
Thanks for signing up! | ||
</h1> | ||
<p class="text-base font-normal text-gray-500 dark:text-gray-400"> | ||
We've sent you an email. Please click the link inside of it to confirm your registration. | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
</section> |
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,36 @@ | ||
import {Component, inject, OnDestroy, OnInit} from '@angular/core'; | ||
import {AuthService} from '../services/auth.service'; | ||
import {FormControl, FormGroup, ReactiveFormsModule, Validators} from '@angular/forms'; | ||
import {distinctUntilChanged, filter, firstValueFrom, lastValueFrom, map, Subject, takeUntil} from 'rxjs'; | ||
import {ActivatedRoute, Router, RouterLink} from '@angular/router'; | ||
import {SettingsService} from '../services/settings.service'; | ||
import {ToastService} from '../services/toast.service'; | ||
|
||
@Component({ | ||
selector: 'app-verify', | ||
imports: [ReactiveFormsModule], | ||
templateUrl: './verify.component.html', | ||
}) | ||
export class VerifyComponent implements OnInit, OnDestroy { | ||
private readonly auth = inject(AuthService); | ||
private readonly settings = inject(SettingsService); | ||
private readonly toast = inject(ToastService); | ||
public readonly formGroup = new FormGroup({ | ||
email: new FormControl('', [Validators.required, Validators.email]), | ||
password: new FormControl('', [Validators.required]), | ||
}); | ||
private readonly router = inject(Router); | ||
private readonly destroyed$ = new Subject<void>(); | ||
|
||
async ngOnInit() { | ||
if (this.auth.getClaims().email_verified) { | ||
await firstValueFrom(this.settings.updateUserSettings({emailVerified: true})); | ||
this.toast.success('Your email has been verified'); | ||
await this.router.navigate(['/']); | ||
} | ||
} | ||
|
||
public ngOnDestroy(): void { | ||
this.destroyed$.next(); | ||
} | ||
} |
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
Oops, something went wrong.