log error

This commit is contained in:
Blair Vanderlugt 2021-06-09 15:16:55 -07:00
parent 9989262d7c
commit 849f60307e
1 changed files with 29 additions and 39 deletions

View File

@ -92,6 +92,7 @@ export class AuthService {
const authHeader: string = response.headers.get('WWW-Authenticate'); const authHeader: string = response.headers.get('WWW-Authenticate');
return hobaParseChallengeHeader(authHeader); return hobaParseChallengeHeader(authHeader);
} }
console.log('DEBUG: expected a 401 and www-authenticate header!')
}); });
} }
@ -106,7 +107,6 @@ export class AuthService {
// this.loggingService.sendErrorLevelMessage('Login token failed', this, { error: e }); // this.loggingService.sendErrorLevelMessage('Login token failed', this, { error: e });
//} //}
} else { } else {
try {
const o = await this.getChallenge(); const o = await this.getChallenge();
const r = await signChallenge( const r = await signChallenge(
@ -128,13 +128,6 @@ export class AuthService {
}); });
return return
} }
if (response.status === 403) {
console.log('Getting back a 403 but I think the server should send 200')
//this.errorDialogService.openDialog({
// message: 'You are not authorized to use this system',
//});
// return
}
if (!response.ok) { if (!response.ok) {
console.log("Failed to get a login token with signed challenge 😭", response.statusText) console.log("Failed to get a login token with signed challenge 😭", response.statusText)
return return
@ -147,41 +140,38 @@ export class AuthService {
return true return true
} }
return false return false
} catch (e) {
this.loggingService.sendErrorLevelMessage('Login challenge failed', this, { error: e });
}
} }
} }
async loginResponse(o: { challenge: string; realm: any }): Promise<any> { //async loginResponse(o: { challenge: string; realm: any }): Promise<any> {
const r = await signChallenge( // const r = await signChallenge(
o.challenge, // o.challenge,
o.realm, // o.realm,
environment.cicMetaUrl, // environment.cicMetaUrl,
this.mutableKeyStore // this.mutableKeyStore
); // );
return this.sendSignedChallenge(r); // return this.sendSignedChallenge(r);
// if (error instanceof HttpError) { // // if (error instanceof HttpError) {
// if (error.status === 403) { // // if (error.status === 403) {
// this.errorDialogService.openDialog({ // // this.errorDialogService.openDialog({
// message: 'You are not authorized to use this system', // // message: 'You are not authorized to use this system',
// }); // // });
// } else if (error.status === 401) { // // } else if (error.status === 401) {
// this.errorDialogService.openDialog({ // // this.errorDialogService.openDialog({
// message: // // message:
// 'Unable to authenticate with the service. ' + // // 'Unable to authenticate with the service. ' +
// 'Please speak with the staff at Grassroots ' + // // 'Please speak with the staff at Grassroots ' +
// 'Economics for requesting access ' + // // 'Economics for requesting access ' +
// 'staff@grassrootseconomics.net.', // // 'staff@grassrootseconomics.net.',
// }); // // });
// } // // }
// } else { // // } else {
// // TODO define this error // // // TODO define this error
// this.errorDialogService.openDialog({ message: 'Incorrect key passphrase.' }); // // this.errorDialogService.openDialog({ message: 'Incorrect key passphrase.' });
// } // // }
// resolve(false); // // resolve(false);
} //}
loginView(): void { loginView(): void {
document.getElementById('one').style.display = 'none'; document.getElementById('one').style.display = 'none';