diff --git a/.env.template b/.env.template index 158d2f80..011d823d 100644 --- a/.env.template +++ b/.env.template @@ -1,3 +1,4 @@ +OPEN_AUTH=true # Whether to enable authentication OPENAI_API_KEY= # OpenAI API KEY GOOGLE_TRANSLATE_API_KEY= # Google API KEY(Can be left blank) BASE_URL= # OpenAI API URL diff --git a/apps/server/src/auth/auth.guard.ts b/apps/server/src/auth/auth.guard.ts index 17bae7be..62fb12ce 100644 --- a/apps/server/src/auth/auth.guard.ts +++ b/apps/server/src/auth/auth.guard.ts @@ -23,7 +23,7 @@ export class AuthGuard implements CanActivate { context.getClass(), ]); // return true; - if (isPublic) { + if (isPublic || process.env.OPEN_AUTH !== "false") { // 💡 See this condition return true; }