fix bad auth commit (#487)
This commit is contained in:
parent
a0a0ec86f0
commit
aed9757409
2 changed files with 5 additions and 5 deletions
|
@ -17,13 +17,13 @@ type CalendsoSessionUser = DefaultSessionUser & {
|
||||||
id: number;
|
id: number;
|
||||||
username: string;
|
username: string;
|
||||||
};
|
};
|
||||||
interface Session extends DefaultSession {
|
export interface Session extends DefaultSession {
|
||||||
user?: CalendsoSessionUser;
|
user?: CalendsoSessionUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getSession(options: GetSessionOptions): Promise<CalendsoSession | null> {
|
export async function getSession(options: GetSessionOptions): Promise<Session | null> {
|
||||||
const session = await getSessionInner(options);
|
const session = await getSessionInner(options);
|
||||||
|
|
||||||
// that these are equal are ensured in `[...nextauth]`'s callback
|
// that these are equal are ensured in `[...nextauth]`'s callback
|
||||||
return session as CalendsoSession;
|
return session as Session | null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import NextAuth from "next-auth";
|
import NextAuth from "next-auth";
|
||||||
import Providers from "next-auth/providers";
|
import Providers from "next-auth/providers";
|
||||||
import prisma from "../../../lib/prisma";
|
import prisma from "../../../lib/prisma";
|
||||||
import { CalendsoSession, verifyPassword } from "../../../lib/auth";
|
import { Session, verifyPassword } from "../../../lib/auth";
|
||||||
|
|
||||||
export default NextAuth({
|
export default NextAuth({
|
||||||
session: {
|
session: {
|
||||||
|
@ -59,7 +59,7 @@ export default NextAuth({
|
||||||
return token;
|
return token;
|
||||||
},
|
},
|
||||||
async session(session, token) {
|
async session(session, token) {
|
||||||
const calendsoSession: CalendsoSession = {
|
const calendsoSession: Session = {
|
||||||
...session,
|
...session,
|
||||||
user: {
|
user: {
|
||||||
...session.user,
|
...session.user,
|
||||||
|
|
Loading…
Reference in a new issue