metamigo: do nextauth v3 -> v4 upgrades
This commit is contained in:
parent
a33f80c497
commit
45f8cb1234
13 changed files with 158 additions and 123 deletions
|
|
@ -7,6 +7,7 @@ import Cognito from "next-auth/providers/cognito";
|
|||
import { loadConfig, IAppConfig } from "@digiresilience/metamigo-config";
|
||||
import { MetamigoAdapter } from "../../../lib/nextauth-adapter";
|
||||
import { CloudflareAccessProvider } from "../../../lib/cloudflare";
|
||||
import { AdapterSession, AdapterUser } from "next-auth/adapters";
|
||||
|
||||
const nextAuthOptions = (config: IAppConfig, req: NextApiRequest) => {
|
||||
const { nextAuth, cfaccess } = config;
|
||||
|
|
@ -72,11 +73,6 @@ const nextAuthOptions = (config: IAppConfig, req: NextApiRequest) => {
|
|||
providers,
|
||||
adapter,
|
||||
callbacks: {
|
||||
async session(session: any, token: any) {
|
||||
// make the user id available in the react client
|
||||
session.user.id = token.userId;
|
||||
return session;
|
||||
},
|
||||
async jwt(token: any, user: any) {
|
||||
const isSignIn = Boolean(user);
|
||||
// Add auth_time to token on signin in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue