Skip to content

Commit

Permalink
feat: add env OPEN_AUTH
Browse files Browse the repository at this point in the history
After closing, you can skip identity verification.
  • Loading branch information
hqwuzhaoyi committed Oct 21, 2023
1 parent f6ba01f commit 9a43a41
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/auth/auth.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 9a43a41

Please sign in to comment.