Skip to content

Adrienne / Handle OIDC errors by logging them #966

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/javascript/_common/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
};

export const requestSingleSignOn = async () => {
const _requestSingleSignOn = async () => {

Check warning on line 130 in src/javascript/_common/auth.js

View workflow job for this annotation

GitHub Actions / Build and Test

Unexpected dangling '_' in '_requestSingleSignOn'

Check warning on line 130 in src/javascript/_common/auth.js

View workflow job for this annotation

GitHub Actions / build_and_deploy_preview_link

Unexpected dangling '_' in '_requestSingleSignOn'
// if we have previously logged in,
// this cookie will be set by the Callback page (which is exported from @deriv-com/auth-client library) to true when we have successfully logged in from other apps
const isLoggedInCookie = Cookies.get('logged_state') === 'true';
Expand All @@ -152,9 +152,13 @@

if (shouldRequestSignOn) {
const currentLanguage = Language.get();
await requestOidcAuthentication({
redirectCallbackUri: `${window.location.origin}/${currentLanguage}/callback`,
});
try {
await requestOidcAuthentication({
redirectCallbackUri: `${window.location.origin}/${currentLanguage}/callback`,
});
} catch (err) {
console.error(err);

Check failure on line 160 in src/javascript/_common/auth.js

View workflow job for this annotation

GitHub Actions / Build and Test

Unexpected console statement

Check failure on line 160 in src/javascript/_common/auth.js

View workflow job for this annotation

GitHub Actions / build_and_deploy_preview_link

Unexpected console statement
}
}
};

Expand Down
15 changes: 9 additions & 6 deletions src/javascript/app/base/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -680,12 +680,15 @@
const redirectCallbackUri = `${window.location.origin}/${currentLanguage}/callback`;
const postLoginRedirectUri = window.location.origin;
const postLogoutRedirectUri = `${window.location.origin}/${currentLanguage}/trading`;
// Test commit
await requestOidcAuthentication({
redirectCallbackUri,
postLoginRedirectUri,
postLogoutRedirectUri,
});
try {
await requestOidcAuthentication({
redirectCallbackUri,
postLoginRedirectUri,
postLogoutRedirectUri,
});
} catch (err) {
console.error(err);

Check failure on line 690 in src/javascript/app/base/header.js

View workflow job for this annotation

GitHub Actions / Build and Test

Unexpected console statement

Check failure on line 690 in src/javascript/app/base/header.js

View workflow job for this annotation

GitHub Actions / build_and_deploy_preview_link

Unexpected console statement
}
} else {
Login.redirectToLogin();
}
Expand Down
Loading