Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
🐛 Allow users to login with oauth provider (#1754)
Luke Vellaf87151b5b4f1
diff --git a/apps/web/public/locales/en/app.json b/apps/web/public/locales/en/app.jsonindex 47c95c4b3..7c765e1ae 100644--- a/apps/web/public/locales/en/app.json+++ b/apps/web/public/locales/en/app.json@@ -387,7 +387,6 @@"licenseKeyErrorInvalidLicenseKey": "Invalid license key","licenseKeyGenericError": "An error occurred while validating the license key","activate": "Activate",- "authErrorsRegistrationDisabled": "Registration is currently disabled. Please try again later.","authErrorsEmailNotVerified": "Your email address is not verified. Please verify your email before logging in.","authErrorsUserBanned": "This account has been banned. Please contact support if you believe this is an error.","authErrorsEmailBlocked": "This email address is not allowed. Please use a different email or contact support.",diff --git a/apps/web/src/app/[locale]/(auth)/login/components/auth-errors.tsx b/apps/web/src/app/[locale]/(auth)/login/components/auth-errors.tsxindex 40d8efa57..6198a5cda 100644--- a/apps/web/src/app/[locale]/(auth)/login/components/auth-errors.tsx+++ b/apps/web/src/app/[locale]/(auth)/login/components/auth-errors.tsx@@ -16,15 +16,6 @@ export function AuthErrors() {})}</p>);- case "RegistrationDisabled":- return (- <p className="text-destructive text-sm">- {t("authErrorsRegistrationDisabled", {- defaultValue:- "Registration is currently disabled. Please try again later.",- })}- </p>- );case "EmailNotVerified":return (<p className="text-destructive text-sm">diff --git a/apps/web/src/next-auth.ts b/apps/web/src/next-auth.tsindex 94bbba025..3c2a07a4d 100644--- a/apps/web/src/next-auth.ts+++ b/apps/web/src/next-auth.ts@@ -14,7 +14,6 @@ import { GuestProvider } from "./auth/providers/guest";import { MicrosoftProvider } from "./auth/providers/microsoft";import { OIDCProvider } from "./auth/providers/oidc";import { RegistrationTokenProvider } from "./auth/providers/registration-token";-import { getInstanceSettings } from "./features/instance-settings/queries";import { nextAuthConfig } from "./next-auth.config";const {@@ -120,18 +119,6 @@ const {}}- const isNewUserFromOAuth = !user.role && profile;- // Check for new user login with OAuth provider- if (isNewUserFromOAuth) {- // If role isn't set than the user doesn't exist yet- // This can happen if logging in with an OAuth provider- const instanceSettings = await getInstanceSettings();-- if (instanceSettings?.disableUserRegistration) {- return "/login?error=RegistrationDisabled";- }- }-// If this is an existing registered userif (user.id && user.role && user.email) {// merge guest user into existing user