fix auth error: "name is required" (#2668)

This commit is contained in:
Amruth Pillai
2026-01-31 17:09:14 +01:00
committed by GitHub
parent c4d5dd4a3c
commit 1509678578
5 changed files with 113 additions and 112 deletions
-4
View File
@@ -120,10 +120,6 @@ const getAuthConfig = () => {
},
},
additionalFields: {
name: {
type: "string",
required: true,
},
username: {
type: "string",
required: true,
+1 -1
View File
@@ -12,5 +12,5 @@ export const getSession = createIsomorphicFn()
})
.server(async (): Promise<AuthSession | null> => {
const result = await auth.api.getSession({ headers: getRequestHeaders() });
return result;
return result as AuthSession | null;
});
+6 -1
View File
@@ -1,7 +1,12 @@
import z from "zod";
import type { auth } from "./config";
export type AuthSession = typeof auth.$Infer.Session;
export type AuthSession = {
session: typeof auth.$Infer.Session.session;
user: typeof auth.$Infer.Session.user & {
name: string;
};
};
const authProviderSchema = z.enum(["credential", "google", "github", "custom"]);