@ -2,7 +2,7 @@ export default function loginPageHref(redirectUrl?: string) {
return {
pathname: '/login',
query: {
redirect:
callbackUrl:
typeof window !== 'undefined'
? redirectUrl ?? window.location.href
: null,
@ -20,6 +20,9 @@ export const authOptions: NextAuthOptions = {
return session;
},
pages: {
signIn: '/login',
providers: [
GitHubProvider({
clientId: env.GITHUB_CLIENT_ID,
@ -54,9 +54,9 @@ export default function LoginPage({
onClick={() =>
signIn(
provider.id,
router.query.redirect != null
router.query.callbackUrl != null
? {
callbackUrl: String(router.query.redirect),
callbackUrl: String(router.query.callbackUrl),
}
: undefined,
)
@ -127,7 +127,7 @@ export default function SettingsPage() {
if (session == null) {
return null;
return <p>You are not signed in</p>;
return (