feat(auth): base available login methods off GoTrue providers (#1869)

* feat(auth): base login fields on GoTrue providers

Signed-off-by: Goostaf <gasplund2@gmail.com>

# Conflicts:
#	app/(auth)/login/login-client.tsx
#	app/(auth)/register/page.tsx

* fix: address feedback

Signed-off-by: Goostaf <gasplund2@gmail.com>

* chore: remove hardcoded Google enabled checks

Signed-off-by: Goostaf <gasplund2@gmail.com>

# Conflicts:
#	.env.example

* feat: show label when password login is disabled

Signed-off-by: Goostaf <gasplund2@gmail.com>

* feat: use MicrosoftMark, correct comment

Signed-off-by: Goostaf <gasplund2@gmail.com>

* feat: display custom providers

Signed-off-by: Goostaf <gasplund2@gmail.com>

* feat: show when no methods are available

Signed-off-by: Goostaf <gasplund2@gmail.com>

* feat: display custom provider labels

Signed-off-by: Goostaf <gasplund2@gmail.com>

* feat: add SAML login path

Signed-off-by: Goostaf <gasplund2@gmail.com>

* feat: show when no methods are available

Signed-off-by: Goostaf <gasplund2@gmail.com>

* fix: display SAML button when enabled

Signed-off-by: Goostaf <gasplund2@gmail.com>

* fix: preserve nextPath and broken key

Signed-off-by: Goostaf <gasplund2@gmail.com>

* fix: redirect test to client

Signed-off-by: Goostaf <gasplund2@gmail.com>

* fix: expose registerEnabled

Signed-off-by: Goostaf <gasplund2@gmail.com>

* feat: provider allowlist and request timeout

Signed-off-by: Goostaf <gasplund2@gmail.com>

* fix: restore compact labels

Signed-off-by: Goostaf <gasplund2@gmail.com>

* refactor: move withTimeout implementation to utils

Signed-off-by: Goostaf <gasplund2@gmail.com>

* fix: include nextPath

Signed-off-by: Goostaf <gasplund2@gmail.com>

* fix: export function and test case

Signed-off-by: Goostaf <gasplund2@gmail.com>

* feat: only show SAML button if vars configured

Signed-off-by: Goostaf <gasplund2@gmail.com>

* fix(auth): map SAML sign-in error through getErrorMessage

The antipattern ratchet (check:guards, raw-user-error) rejects a raw
error.message reaching a user-visible sink. Route the signInWithSSO
error through getErrorMessage like the other auth error paths.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013BAzJjXQBa9F5L1U42wUMj
Signed-off-by: Jakob Wennberg <311770904+jakobwennberg-oss@users.noreply.github.com>

* feat(auth): GitHub brand mark on the provider button; decision log

GitHub allows its invertocat in solid black/white, so currentColor is
correct; custom OIDC providers keep the generic key icon.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013BAzJjXQBa9F5L1U42wUMj
Signed-off-by: Jakob Wennberg <311770904+jakobwennberg-oss@users.noreply.github.com>

---------

Signed-off-by: Goostaf <gasplund2@gmail.com>
Signed-off-by: Jakob Wennberg <311770904+jakobwennberg-oss@users.noreply.github.com>
Co-authored-by: Jakob Wennberg <311770904+jakobwennberg-oss@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Goostaf
2026-08-31 09:13:39 +01:00
committed by GitHub
co-authored by Claude Fable 5 Jakob Wennberg
parent dc07ca8872
commit 6ac9679fb5
19 changed files with 1728 additions and 1078 deletions
+7 -4
View File
@@ -302,9 +302,10 @@
"login_error_rate_limited": "Too many sign-in attempts. Wait a moment and try again.",
"login_error_user_banned": "This account has been suspended. Contact support if you think this is a mistake.",
"login_error_reset_link": "Reset your password",
"continue_with_google": "Continue with Google",
"callback_error_title_oauth": "Google sign-in didn't work",
"callback_error_body_oauth": "The Google sign-in could not be completed. Try again, or sign in with email and password.",
"continue_with_provider": "Continue with {provider}",
"saml_no_domain": "SAML is not configured. Contact your administrator.",
"callback_error_title_oauth": "External sign-in didn't work",
"callback_error_body_oauth": "The external sign-in could not be completed. Try again, or sign in with another method.",
"session_idle": "You were inactive. Sign in again.",
"session_absolute": "Your session expired for security reasons.",
"use_password_instead": "Sign in with email instead",
@@ -342,6 +343,7 @@
"bankid_resume_continue": "Continue",
"bankid_resume_hint": "Complete the BankID identification...",
"bankid_resume_restart": "Start over",
"no_login_methods": "No sign-in methods are available on this installation. Contact your administrator.",
"terms_prefix": "By signing in you agree to our",
"terms_link": "terms",
"terms_and": "and",
@@ -1242,7 +1244,8 @@
"confirm_email_hint": "Click the link in the email to activate your account. The link is valid for 24 hours.",
"open_webmail_search": "Find the email in {provider}",
"open_webmail_inbox": "Open {provider}",
"back_to_login": "Back to sign in"
"back_to_login": "Back to sign in",
"password_signup_unavailable": "Password sign-up is not available on this installation."
},
"mfa": {
"enroll_title": "Set up two-step verification",
+7 -4
View File
@@ -302,9 +302,10 @@
"login_error_rate_limited": "För många inloggningsförsök. Vänta en stund och försök igen.",
"login_error_user_banned": "Kontot är avstängt. Kontakta supporten om du tror att det är fel.",
"login_error_reset_link": "Återställ lösenordet",
"continue_with_google": "Fortsätt med Google",
"callback_error_title_oauth": "Google-inloggningen fungerade inte",
"callback_error_body_oauth": "Inloggningen med Google kunde inte slutföras. Försök igen, eller logga in med e-post och lösenord.",
"continue_with_provider": "Fortsätt med {provider}",
"saml_no_domain": "SAML är inte konfigurerat. Kontakta din administratör.",
"callback_error_title_oauth": "Extern inloggning misslyckades",
"callback_error_body_oauth": "Inloggningen med extern tjänst kunde inte slutföras. Försök igen, eller logga in med en annan metod.",
"session_idle": "Du har varit inaktiv. Logga in igen.",
"session_absolute": "Sessionen har upphört av säkerhetsskäl.",
"use_password_instead": "Logga in med e-post i stället",
@@ -342,6 +343,7 @@
"bankid_resume_continue": "Fortsätt",
"bankid_resume_hint": "Slutför BankID-identifieringen...",
"bankid_resume_restart": "Starta om",
"no_login_methods": "Inga inloggningsmetoder är tillgängliga på den här installationen. Kontakta din administratör.",
"terms_prefix": "Genom att logga in godkänner du våra",
"terms_link": "villkor",
"terms_and": "och",
@@ -1242,7 +1244,8 @@
"confirm_email_hint": "Klicka på länken i e-posten för att aktivera ditt konto. Länken är giltig i 24 timmar.",
"open_webmail_search": "Hitta e-posten i {provider}",
"open_webmail_inbox": "Öppna {provider}",
"back_to_login": "Tillbaka till inloggning"
"back_to_login": "Tillbaka till inloggning",
"password_signup_unavailable": "Lösenordsregistrering är inte tillgänglig på den här installationen."
},
"mfa": {
"enroll_title": "Aktivera tvåstegsverifiering",