callbackUrl
使う。
import { signIn, signOut } from 'next-auth/client'; signIn('google'{ callbackUrl: `http://localhost/foo` }); signOut({ callbackUrl: `http://localhost/foo` });
.env.localNEXT_PUBLIC_BASE_URL="http://localhost:3000"
import { signIn, signOut } from 'next-auth/client'; signIn('google', { callbackUrl: `${ process.env.NEXT_PUBLIC_BASE_URL || 'http://localhost:3000' }/foo`, }); signOut({ callbackUrl: `${ process.env.NEXT_PUBLIC_BASE_URL || 'http://localhost:3000' }/foo`, });
||
はもっといい使い方あるかも。
env.local
を修正したら、再起動しましょう。