-
Notifications
You must be signed in to change notification settings - Fork 44.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(platform): Enable auth on local-backend mode by default (#8405)
- Loading branch information
Showing
9 changed files
with
47 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,19 +37,17 @@ async def get_user_by_id(user_id: str) -> Optional[User]: | |
return User.model_validate(user) if user else None | ||
|
||
|
||
async def create_default_user(enable_auth: str) -> Optional[User]: | ||
if not enable_auth.lower() == "true": | ||
user = await prisma.user.find_unique(where={"id": DEFAULT_USER_ID}) | ||
if not user: | ||
user = await prisma.user.create( | ||
data={ | ||
"id": DEFAULT_USER_ID, | ||
"email": "[email protected]", | ||
"name": "Default User", | ||
} | ||
) | ||
return User.model_validate(user) | ||
return None | ||
async def create_default_user() -> Optional[User]: | ||
user = await prisma.user.find_unique(where={"id": DEFAULT_USER_ID}) | ||
if not user: | ||
user = await prisma.user.create( | ||
data={ | ||
"id": DEFAULT_USER_ID, | ||
"email": "[email protected]", | ||
"name": "Default User", | ||
} | ||
) | ||
return User.model_validate(user) | ||
|
||
|
||
async def get_user_metadata(user_id: str) -> UserMetadataRaw: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import os | ||
|
||
os.environ["ENABLE_AUTH"] = "false" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters