Skip to content

Commit 5499d86

Browse files
committed
Start on nag about verifying emails
1 parent a5bd3bd commit 5499d86

File tree

7 files changed

+29
-1
lines changed

7 files changed

+29
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<p>header-bar-verify-email works!</p>
2+
<p *ngIf="show">Should display nag about verifying email!</p>

src/app/_layout/header-bar/header-bar-verify-email/header-bar-verify-email.component.scss

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { Component, OnInit } from '@angular/core';
2+
import { UserService } from '../../../../services/user.service';
3+
4+
@Component({
5+
selector: 'app-header-bar-verify-email',
6+
templateUrl: './header-bar-verify-email.component.html',
7+
styleUrls: ['./header-bar-verify-email.component.scss']
8+
})
9+
export class HeaderBarVerifyEmailComponent implements OnInit {
10+
11+
constructor(private userService: UserService) { }
12+
13+
ngOnInit(): void {
14+
}
15+
16+
get show(): boolean {
17+
return this.userService.user && !this.userService.user.emailVerified;
18+
}
19+
20+
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<header>
22
<app-header-bar-display-name></app-header-bar-display-name>
3+
<app-header-bar-verify-email></app-header-bar-verify-email>
34
<app-header-bar-cookies *ngIf="showCookieBar" (visibilityUpdated)="showCookieBar = $event"></app-header-bar-cookies>
45
<app-header-bar-nav></app-header-bar-nav>
56
</header>

src/app/app.module.ts

+2
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ import { HeaderBarUserComponent } from './_layout/header-bar/header-bar-user/hea
5555
import { UnauthorizedComponent } from './unauthorized/unauthorized.component';
5656
import { HeaderBarDisplayNameComponent } from './_layout/header-bar/header-bar-display-name/header-bar-display-name.component';
5757
import { LoginComponent } from './auth/login/login.component';
58+
import { HeaderBarVerifyEmailComponent } from './_layout/header-bar/header-bar-verify-email/header-bar-verify-email.component';
5859

5960
const appRoutes: Routes = [
6061
{
@@ -143,6 +144,7 @@ const appRoutes: Routes = [
143144
HeaderBarUserComponent,
144145
UnauthorizedComponent,
145146
HeaderBarDisplayNameComponent,
147+
HeaderBarVerifyEmailComponent,
146148
],
147149
imports: [
148150
BrowserModule,

src/app/auth/sign-up/sign-up.component.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,12 @@ export class SignUpComponent {
5151
const result = await this.authService.performRegister(this.data);
5252

5353
if (result.status === 'SIGNUP_SUCCESS') {
54-
//
54+
this.showNextStep = true;
5555
}
5656
} catch (e: any) {
5757
console.log(e);
58+
this.showNextStep = false;
59+
// TODO: show any errors
5860
} finally {
5961
this.loading = false;
6062
}

src/model/user.ts

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export class User {
1212
pronouns: string;
1313
languagesSpoken: string;
1414
mfaEnabled: boolean;
15+
emailVerified: boolean;
1516
country: string;
1617
roles: string[];
1718
connections: SocialAccount[];

0 commit comments

Comments
 (0)