generated from nhcarrigan/template
feat: initial project prototype #2
@ -45,25 +45,20 @@ export class ReviewComponent {
|
|||||||
if (!storedToken) {
|
if (!storedToken) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.token.setValue(storedToken);
|
this.apiService.validateToken(storedToken)
|
||||||
|
.then((valid) => {
|
||||||
|
if (valid) {
|
||||||
this.valid = true;
|
this.valid = true;
|
||||||
|
this.token.setValue(storedToken);
|
||||||
/*
|
} else {
|
||||||
* This.apiService
|
this.error = 'The token found in local storage is invalid.';
|
||||||
* .validateToken(storedToken)
|
this.valid = false;
|
||||||
* .then((valid) => {
|
}
|
||||||
* if (valid) {
|
})
|
||||||
* this.valid = true;
|
.catch(() => {
|
||||||
* } else {
|
this.error = 'An error occurred while validating the token found in local storage.';
|
||||||
* this.error = 'The token found in local storage is invalid.';
|
this.valid = false;
|
||||||
* this.valid = false;
|
});
|
||||||
* }
|
|
||||||
* })
|
|
||||||
* .catch(() => {
|
|
||||||
* this.error = 'An error occurred while validating your stored token.';
|
|
||||||
* this.valid = false;
|
|
||||||
* });
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user