Enhance authentication flow with username support and social login placeholders

- Updated sign-in and sign-up pages to allow users to log in with either email or username.
- Added social login options for Google and Apple, currently implemented as placeholders.
- Improved error handling with localized messages for authentication failures.
- Refactored input fields and validation logic to enhance user experience and accessibility.
This commit is contained in:
Matthias
2026-04-02 23:10:40 +02:00
parent 9fa0b8452e
commit f5f9753288
5 changed files with 379 additions and 25 deletions

View File

@@ -8,7 +8,7 @@ import { internal } from "./_generated/api";
import { DataModel } from "./_generated/dataModel";
import { query } from "./_generated/server";
import { betterAuth } from "better-auth/minimal";
import { magicLink } from "better-auth/plugins";
import { magicLink, username } from "better-auth/plugins";
import { Resend } from "resend";
import authConfig from "./auth.config";
@@ -128,10 +128,14 @@ export const createAuth = (ctx: GenericCtx<DataModel>) => {
}
},
}),
username(),
convex({ authConfig }),
polar({
client: polarClient,
createCustomerOnSignUp: true,
// Keep signup resilient: Polar customer sync is best-effort and should
// never fail account creation. Checkout/portal flows can still create
// and use customers via externalCustomerId when needed.
createCustomerOnSignUp: false,
use: [
checkout({
successUrl: `${siteUrl}/dashboard?checkout=success`,