Skip to content

Commit

Permalink
fix(authentication): avoid silent renew on sign-in
Browse files Browse the repository at this point in the history
Signed-off-by: Joris Mancini <[email protected]>
  • Loading branch information
TheMaskedTurtle committed Dec 19, 2023
1 parent 8956c0a commit ff1b5f9
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/utils/AuthService.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,18 @@ function handleSigninSilent(dispatch, userManager) {
});
}

function initializeAuthenticationDev(dispatch, isSilentRenew, validateUser) {
function initializeAuthenticationDev(
dispatch,
isSilentRenew,
validateUser,
isSigninCallback
) {
let userManager = new UserManagerMock({});
if (!isSilentRenew) {
handleUser(dispatch, userManager, validateUser);
handleSigninSilent(dispatch, userManager);
if (!isSigninCallback) {
handleSigninSilent(dispatch, userManager);
}
}
return Promise.resolve(userManager);
}
Expand All @@ -60,7 +67,8 @@ function initializeAuthenticationProd(
isSilentRenew,
idpSettings,
validateUser,
authorizationCodeFlowEnabled
authorizationCodeFlowEnabled,
isSigninCallback
) {
return idpSettings
.then((r) => r.json())
Expand Down Expand Up @@ -179,7 +187,9 @@ function initializeAuthenticationProd(
userManager.idpSettings = idpSettings; //store our settings in there as well to use it later
if (!isSilentRenew) {
handleUser(dispatch, userManager, validateUser);
handleSigninSilent(dispatch, userManager);
if (!isSigninCallback) {
handleSigninSilent(dispatch, userManager);
}
}
return userManager;
})
Expand Down

0 comments on commit ff1b5f9

Please sign in to comment.