File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed
Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -23,14 +23,15 @@ export default function Login(): React.ReactElement {
2323 // Automatically redirect user to first supported auth method
2424 // Unless there is ekirjasto authentication, then redirect to that
2525 React . useEffect ( ( ) => {
26- const ekirjastoAuth = supportedAuthMethods . find (
27- method => method . type === EKIRJASTO_AUTH_TYPE
28- ) ;
29- if ( ekirjastoAuth ) {
30- initLogin ( ekirjastoAuth . id ) ;
31- }
3226 if ( supportedAuthMethods . length > 0 ) {
33- initLogin ( supportedAuthMethods [ 0 ] . id ) ;
27+ const ekirjastoAuth = supportedAuthMethods . find (
28+ method => method . type === EKIRJASTO_AUTH_TYPE
29+ ) ;
30+ if ( ekirjastoAuth ) {
31+ initLogin ( ekirjastoAuth . id ) ;
32+ } else {
33+ initLogin ( supportedAuthMethods [ 0 ] . id ) ;
34+ }
3435 }
3536 } , [ supportedAuthMethods , initLogin ] ) ;
3637
Original file line number Diff line number Diff line change @@ -24,7 +24,10 @@ export default async function handler(
2424 const authenticateHref = await fetchEkirjastoAuthenticationLink ( ) ;
2525
2626 // Get circulation token
27- const { accessToken } = await fetchEAuthToken ( authenticateHref , token ) ;
27+ const { access_token : accessToken } = await fetchEAuthToken (
28+ authenticateHref ,
29+ token
30+ ) ;
2831
2932 // Set the circulation token as a cookie that can be read on the other page and stored
3033 res . setHeader (
You can’t perform that action at this time.
0 commit comments