Skip to content

Commit 57b743b

Browse files
committed
confirm email component
1 parent 8e36ef5 commit 57b743b

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

app/components/confirm-email.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import ErrorHandlingComponent from './error-handling';
22
import { tracked } from '@glimmer/tracking';
3+
import { service } from '@ember/service';
34
import $ from 'jquery';
45

56
export default class ConfirmEmailComponent extends ErrorHandlingComponent {
7+
@service errorHandling;
68
@tracked confirmTokenErrors = [];
79
@tracked isAlreadyConfirmed = false;
810
@tracked invalidTokenError = null;
@@ -15,7 +17,7 @@ export default class ConfirmEmailComponent extends ErrorHandlingComponent {
1517
$.get({
1618
url: `/auth/confirm/${token}`,
1719
})
18-
.then((res) => {
20+
.then((res) => {π
1921
if (res.isValid) {
2022
this.isTokenValid = true;
2123
} else {
@@ -29,11 +31,15 @@ export default class ConfirmEmailComponent extends ErrorHandlingComponent {
2931
}
3032
})
3133
.catch((err) => {
32-
this[err] = 'confirmTokenErrors';
34+
this.errorHandling.handleErrors(err, 'confirmTokenErrors');
3335
});
3436
}
3537
}
3638

39+
get confirmTokenErrors () {
40+
return this.errorHandling.getErrors('confirmTokenErrors');
41+
}
42+
3743
get loginMessage() {
3844
if (this.isAlreadyConfirmed) {
3945
return 'to get started using EnCoMPASS';

0 commit comments

Comments
 (0)