mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-08-21 14:01:42 +10:00
fix(auth): allow implicit social signup
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { env } from "@reactive-resume/env/server";
|
||||
import { auth } from "./config";
|
||||
|
||||
describe("social provider signup policy", () => {
|
||||
it.each(["google", "github", "linkedin"] as const)(
|
||||
"allows implicit signup through %s while honoring the global signup restriction",
|
||||
(provider) => {
|
||||
const config = auth.options.socialProviders?.[provider];
|
||||
|
||||
expect(config).not.toHaveProperty("disableImplicitSignUp");
|
||||
expect(config?.disableSignUp).toBe(env.FLAG_DISABLE_SIGNUPS);
|
||||
},
|
||||
);
|
||||
});
|
||||
@@ -197,7 +197,6 @@ const getAuthConfig = () => {
|
||||
google: {
|
||||
enabled: !!env.GOOGLE_CLIENT_ID && !!env.GOOGLE_CLIENT_SECRET,
|
||||
disableSignUp: env.FLAG_DISABLE_SIGNUPS,
|
||||
disableImplicitSignUp: true,
|
||||
clientId: env.GOOGLE_CLIENT_ID ?? "",
|
||||
clientSecret: env.GOOGLE_CLIENT_SECRET ?? "",
|
||||
mapProfileToUser: createProfileMapper({
|
||||
@@ -210,7 +209,6 @@ const getAuthConfig = () => {
|
||||
github: {
|
||||
enabled: !!env.GITHUB_CLIENT_ID && !!env.GITHUB_CLIENT_SECRET,
|
||||
disableSignUp: env.FLAG_DISABLE_SIGNUPS,
|
||||
disableImplicitSignUp: true,
|
||||
clientId: env.GITHUB_CLIENT_ID ?? "",
|
||||
clientSecret: env.GITHUB_CLIENT_SECRET ?? "",
|
||||
mapProfileToUser: createGithubProfileMapper(),
|
||||
@@ -219,7 +217,6 @@ const getAuthConfig = () => {
|
||||
linkedin: {
|
||||
enabled: !!env.LINKEDIN_CLIENT_ID && !!env.LINKEDIN_CLIENT_SECRET,
|
||||
disableSignUp: env.FLAG_DISABLE_SIGNUPS,
|
||||
disableImplicitSignUp: true,
|
||||
clientId: env.LINKEDIN_CLIENT_ID ?? "",
|
||||
clientSecret: env.LINKEDIN_CLIENT_SECRET ?? "",
|
||||
mapProfileToUser: createProfileMapper({
|
||||
|
||||
Reference in New Issue
Block a user