♻️ Switch to next-auth for handling authentication (#899)

This commit is contained in:
Luke Vella 2023-10-19 09:14:53 +01:00 committed by GitHub
parent 5f9e428432
commit 6fa66da681
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
65 changed files with 1514 additions and 1586 deletions

38
apps/web/declarations/next-auth.d.ts vendored Normal file
View file

@ -0,0 +1,38 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import type { TimeFormat } from "@rallly/database";
import { extend } from "lodash";
import NextAuth, { DefaultSession, DefaultUser } from "next-auth";
import { DefaultJWT, JWT } from "next-auth/jwt";
declare module "next-auth" {
/**
* Returned by `useSession`, `getSession` and received as a prop on the `SessionProvider` React Context
*/
interface Session {
user: {
id: string;
name?: string | null;
email?: string | null;
timeZone?: string | null;
timeFormat?: TimeFormat | null;
locale?: string | null;
weekStart?: number | null;
};
}
interface User extends DefaultUser {
locale?: string | null;
timeZone?: string | null;
timeFormat?: TimeFormat | null;
weekStart?: number | null;
}
}
declare module "next-auth/jwt" {
interface JWT extends DefaultJWT {
locale?: string | null;
timeZone?: string | null;
timeFormat?: TimeFormat | null;
weekStart?: number | null;
}
}