adde diagnostic logging
This commit is contained in:
@@ -11,6 +11,14 @@ export const authConfig: NextAuthConfig = {
|
|||||||
const isLoggedIn = !!auth?.user;
|
const isLoggedIn = !!auth?.user;
|
||||||
return (isLoggedIn);
|
return (isLoggedIn);
|
||||||
},
|
},
|
||||||
|
redirect({ url, baseUrl }) {
|
||||||
|
console.log(`redirect(url=${url}, baseUrl=${baseUrl})`);
|
||||||
|
return url.startsWith(baseUrl) ? url : baseUrl;
|
||||||
|
},
|
||||||
|
signIn({ user, account, profile, email, credentials }) {
|
||||||
|
console.log(`signIn(user=${user}, account=${account}, profile=${profile}, email=${email}, credentials=${credentials})`);
|
||||||
|
return true;
|
||||||
|
},
|
||||||
// method is called when the user is not logged in
|
// method is called when the user is not logged in
|
||||||
// this is a hack which takes user ID and assigns it temporaty to the token, which is then used to extend Session.user
|
// this is a hack which takes user ID and assigns it temporaty to the token, which is then used to extend Session.user
|
||||||
// see: https://stackoverflow.com/questions/70409219/get-user-id-from-session-in-next-auth-client
|
// see: https://stackoverflow.com/questions/70409219/get-user-id-from-session-in-next-auth-client
|
||||||
|
|||||||
Reference in New Issue
Block a user