Skip to content

Commit

Permalink
improve oauth error message
Browse files Browse the repository at this point in the history
  • Loading branch information
ruddell committed Dec 6, 2021
1 parent 2898857 commit 28c5c6d
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ export function * login (api) {
yield put({ type: 'RELOGIN_OK' });
}
} catch (e) {
let errorMessage = e.type === 'Dismiss' ? 'Login Modal dismissed' : 'Login failed, please try again';
let errorMessage = 'Login failed, please try again'
if (e.type === 'cancel' || e.type === 'dismiss') {
errorMessage = 'Login dismissed'
} else if (e.type === 'error') {
errorMessage += ` (code ${e.errorCode})`
}
yield put(LoginActions.loginFailure(errorMessage));
if (AppConfig.debugMode) {
console.error(e);
Expand Down

0 comments on commit 28c5c6d

Please sign in to comment.