1 import { Component, OnInit } from '@angular/core'
2 import { ActivatedRoute } from '@angular/router'
3 import { AuthService, Notifier } from '@app/core'
4 import { UserSignupService } from '@app/shared/shared-users'
7 selector: 'my-verify-account-email',
8 templateUrl: './verify-account-email.component.html'
11 export class VerifyAccountEmailComponent implements OnInit {
14 isPendingEmail = false
16 private userId: number
17 private verificationString: string
20 private userSignupService: UserSignupService,
21 private authService: AuthService,
22 private notifier: Notifier,
23 private route: ActivatedRoute
28 const queryParams = this.route.snapshot.queryParams
29 this.userId = queryParams['userId']
30 this.verificationString = queryParams['verificationString']
31 this.isPendingEmail = queryParams['isPendingEmail'] === 'true'
33 if (!this.userId || !this.verificationString) {
34 this.notifier.error($localize`Unable to find user id or verification string.`)
41 this.userSignupService.verifyEmail(this.userId, this.verificationString, this.isPendingEmail)
44 if (this.authService.isLoggedIn()) {
45 this.authService.refreshUserInformation()
54 this.notifier.error(err.message)