github 0auth fixes
This commit is contained in:
@@ -17,8 +17,13 @@ export const authComponent = createClient<DataModel>(components.betterAuth);
|
||||
|
||||
const createAuth = (ctx: GenericCtx<DataModel>) =>
|
||||
betterAuth({
|
||||
account: {
|
||||
accountLinking: {
|
||||
allowDifferentEmails: true,
|
||||
},
|
||||
},
|
||||
advanced: { useSecureCookies: siteUrl.startsWith("https://") },
|
||||
baseURL: env.CONVEX_SITE_URL,
|
||||
baseURL: siteUrl,
|
||||
database: authComponent.adapter(ctx),
|
||||
emailAndPassword: {
|
||||
enabled: true,
|
||||
|
||||
@@ -80,13 +80,13 @@ const fetchGiteaUser = async (
|
||||
);
|
||||
}
|
||||
const user = (await response.json()) as {
|
||||
readonly email?: string;
|
||||
readonly email?: string | null;
|
||||
readonly id: number;
|
||||
readonly login: string;
|
||||
};
|
||||
return {
|
||||
externalAccountId: String(user.id),
|
||||
externalEmail: user.email,
|
||||
externalEmail: user.email ?? undefined,
|
||||
externalUsername: user.login,
|
||||
};
|
||||
};
|
||||
@@ -105,13 +105,13 @@ const fetchGithubUser = async (token: string): Promise<ExternalUserInfo> => {
|
||||
);
|
||||
}
|
||||
const user = (await response.json()) as {
|
||||
readonly email?: string;
|
||||
readonly email?: string | null;
|
||||
readonly id: number;
|
||||
readonly login: string;
|
||||
};
|
||||
return {
|
||||
externalAccountId: String(user.id),
|
||||
externalEmail: user.email,
|
||||
externalEmail: user.email ?? undefined,
|
||||
externalUsername: user.login,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user