Bug: is there any way to update authConfig conditionally #113
-
const authConfig = {
clientId: "L8T6bECXcwNV7Fdi4i4Yt8QO2nt4xfu8",
authorizationEndpoint: "https://sdl-preprod.eu.auth0.com/authorize",
tokenEndpoint: "https://sdl-preprod.eu.auth0.com/oauth/token",
redirectUri: `${factory.config.GoGlobalFrontend.URL}login`,
scope: "openid profile email",
clearURL: false,
extraAuthParameters: {
audience: "https://api-preprod.sdl.com",
**signup: false,**
},
onRefreshTokenExpire: (event) =>
window.confirm(
"Session expired. Refresh page to continue using the site?"
) && event.login(),
logoutEndpoint: "https://sdl-preprod.eu.auth0.com/logout",
//logoutRedirect: `${factory.config.GoGlobalFrontend.URL}logout`,
extraLogoutParameters: {
returnTo: `${factory.config.GoGlobalFrontend.URL}logout`,
},
autoLogin: false,
decodeToken: false,
}; In UI I have two button sign in and sign up, <ThemeProvider theme={theme}>
<CssBaseline />
<ServiceFactoryProvider factory={factory}>
<AuthProvider authConfig={authConfig}> I want authConfig to be updated based on condition _Converted from issue by @sebastianvitterso _ |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Did just a bit of testing. But creating two AuthProviders where one has the An other idea could be to have the |
Beta Was this translation helpful? Give feedback.
-
This is now supported for |
Beta Was this translation helpful? Give feedback.
This is now supported for
login()
in version 1.18.0 (https://github.com/soofstad/react-oauth2-pkce?tab=readme-ov-file#api)