log error

This commit is contained in:
Blair Vanderlugt 2021-06-09 15:16:55 -07:00
parent 9989262d7c
commit 849f60307e

View File

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