feat(auth): add email verification feature and handler
Some checks failed
CI / Get Changed Files (pull_request) Successful in 7s
CI / Docker frontend validation (pull_request) Successful in 1m2s
CI / Checkstyle Main (pull_request) Successful in 1m8s
CI / eslint (pull_request) Failing after 1m29s
CI / Docker backend validation (pull_request) Successful in 1m32s
CI / prettier (pull_request) Failing after 31s
CI / oxlint (pull_request) Successful in 44s
CI / test-build (pull_request) Successful in 38s
Some checks failed
CI / Get Changed Files (pull_request) Successful in 7s
CI / Docker frontend validation (pull_request) Successful in 1m2s
CI / Checkstyle Main (pull_request) Successful in 1m8s
CI / eslint (pull_request) Failing after 1m29s
CI / Docker backend validation (pull_request) Successful in 1m32s
CI / prettier (pull_request) Failing after 31s
CI / oxlint (pull_request) Successful in 44s
CI / test-build (pull_request) Successful in 38s
This commit is contained in:
parent
59aa831981
commit
d2225decc1
14 changed files with 124 additions and 27 deletions
|
@ -0,0 +1,31 @@
|
|||
import { Component, inject, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { AuthService } from '@service/auth.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-verify-email',
|
||||
imports: [],
|
||||
templateUrl: './verify-email.component.html',
|
||||
styleUrl: './verify-email.component.css'
|
||||
})
|
||||
export class VerifyEmailComponent implements OnInit{
|
||||
route: ActivatedRoute = inject(ActivatedRoute);
|
||||
router: Router = inject(Router);
|
||||
authService: AuthService = inject(AuthService);
|
||||
|
||||
ngOnInit(): void {
|
||||
const token = this.route.snapshot.queryParamMap.get('token');
|
||||
|
||||
if (!token) {
|
||||
this.router.navigate(['']);
|
||||
console.log('no token');
|
||||
return;
|
||||
}
|
||||
|
||||
this.authService.verifyEmail(token).subscribe(() => {
|
||||
this.router.navigate([''], {
|
||||
queryParams: { login: true },
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
Reference in a new issue