next.js - NextAuth Callbacks Only Fire When Leaving and Returning to Browser Tab - Stack Overflow

admin2025-05-01  1

I'm encountering an issue with NextAuth callbacks. They are not firing when a page is loaded. Instead, the callbacks only trigger when I leave the browser tab and return to the site.


Code Implementation

Here is my current setup for the NextAuth configuration in my project:

apps/next-folio/src/app/api/auth/[...nextauth]/route.ts

const authOptions: NextAuthOptions = {
  callbacks: {
    async signIn(params) {
      console.log(`
转载请注明原文地址:http://www.anycun.com/QandA/1746097026a91625.html