1 import { Component, OnInit } from '@angular/core'
2 import { ActivatedRoute } from '@angular/router'
3 import { AuthService, Notifier, UserService } from '@app/core'
6 selector: 'my-verify-account-email',
7 templateUrl: './verify-account-email.component.html'
10 export class VerifyAccountEmailComponent implements OnInit {
13 isPendingEmail = false
15 private userId: number
16 private verificationString: string
19 private userService: UserService,
20 private authService: AuthService,
21 private notifier: Notifier,
22 private route: ActivatedRoute
27 const queryParams = this.route.snapshot.queryParams
28 this.userId = queryParams['userId']
29 this.verificationString = queryParams['verificationString']
30 this.isPendingEmail = queryParams['isPendingEmail'] === 'true'
32 if (!this.userId || !this.verificationString) {
33 this.notifier.error($localize`Unable to find user id or verification string.`)
40 this.userService.verifyEmail(this.userId, this.verificationString, this.isPendingEmail)
43 if (this.authService.isLoggedIn()) {
44 this.authService.refreshUserInformation()
53 this.notifier.error(err.message)