Spaces:
Sleeping
Sleeping
fix: default auth not properly treated if undefined
Browse files- .env +1 -7
- src/lib/server/auth.ts +1 -1
.env
CHANGED
|
@@ -67,13 +67,7 @@ TASK_MODEL=
|
|
| 67 |
|
| 68 |
### Authentication ###
|
| 69 |
# Parameters to enable open id login
|
| 70 |
-
OPENID_CONFIG
|
| 71 |
-
"PROVIDER_URL": "",
|
| 72 |
-
"CLIENT_ID": "",
|
| 73 |
-
"CLIENT_SECRET": "",
|
| 74 |
-
"SCOPES": "",
|
| 75 |
-
"NAME_CLAIM": ""
|
| 76 |
-
}`
|
| 77 |
MESSAGES_BEFORE_LOGIN=# how many messages a user can send in a conversation before having to login. set to 0 to force login right away
|
| 78 |
# if it's defined, only these emails will be allowed to use login
|
| 79 |
ALLOWED_USER_EMAILS=`[]`
|
|
|
|
| 67 |
|
| 68 |
### Authentication ###
|
| 69 |
# Parameters to enable open id login
|
| 70 |
+
OPENID_CONFIG=
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
MESSAGES_BEFORE_LOGIN=# how many messages a user can send in a conversation before having to login. set to 0 to force login right away
|
| 72 |
# if it's defined, only these emails will be allowed to use login
|
| 73 |
ALLOWED_USER_EMAILS=`[]`
|
src/lib/server/auth.ts
CHANGED
|
@@ -43,7 +43,7 @@ export const OIDConfig = z
|
|
| 43 |
TOLERANCE: stringWithDefault(env.OPENID_TOLERANCE),
|
| 44 |
RESOURCE: stringWithDefault(env.OPENID_RESOURCE),
|
| 45 |
})
|
| 46 |
-
.parse(JSON5.parse(env.OPENID_CONFIG));
|
| 47 |
|
| 48 |
export const requiresUser = !!OIDConfig.CLIENT_ID && !!OIDConfig.CLIENT_SECRET;
|
| 49 |
|
|
|
|
| 43 |
TOLERANCE: stringWithDefault(env.OPENID_TOLERANCE),
|
| 44 |
RESOURCE: stringWithDefault(env.OPENID_RESOURCE),
|
| 45 |
})
|
| 46 |
+
.parse(JSON5.parse(env.OPENID_CONFIG || "{}"));
|
| 47 |
|
| 48 |
export const requiresUser = !!OIDConfig.CLIENT_ID && !!OIDConfig.CLIENT_SECRET;
|
| 49 |
|