({ url, baseUrl })
| 332 | // is visible in code and not dependent on upstream defaults. |
| 333 | // @see https://authjs.dev/reference/core#redirect |
| 334 | async redirect({ url, baseUrl }) { |
| 335 | if (url.startsWith("/")) { |
| 336 | return `${baseUrl}${url}`; |
| 337 | } |
| 338 | |
| 339 | try { |
| 340 | if (new URL(url).origin === baseUrl) { |
| 341 | return url; |
| 342 | } |
| 343 | } catch { |
| 344 | // Malformed URL — fall through to baseUrl. |
| 345 | } |
| 346 | |
| 347 | return baseUrl; |
| 348 | }, |
| 349 | async jwt({ token, user: _user }) { |
| 350 | const user = _user as User | undefined; |
| 351 | // @note: `user` will be available on signUp or signIn triggers. |
no outgoing calls
no test coverage detected