Spaces:
Sleeping
Sleeping
Update private_gpt/server/utils/authentication.py
Browse files
private_gpt/server/utils/authentication.py
CHANGED
@@ -12,7 +12,7 @@ router = APIRouter(
|
|
12 |
tags=['auth']
|
13 |
)
|
14 |
|
15 |
-
SECRET_KEY =
|
16 |
ALGORITHM = 'HS256'
|
17 |
|
18 |
bcrypt_context = CryptContext(schemes=['bcrypt'], deprecated='auto')
|
@@ -21,13 +21,13 @@ oauth2_bearer = OAuth2PasswordBearer(tokenUrl='/v1/auth/token')
|
|
21 |
hardcoded_users = [
|
22 |
{ "id": 1,
|
23 |
"username": "test",
|
24 |
-
"password_hash": bcrypt_context.hash(
|
25 |
"role": "user"
|
26 |
},
|
27 |
|
28 |
{ "id": 2,
|
29 |
"username": "admin",
|
30 |
-
"password_hash": bcrypt_context.hash(
|
31 |
"role": "admin"
|
32 |
},
|
33 |
|
|
|
12 |
tags=['auth']
|
13 |
)
|
14 |
|
15 |
+
SECRET_KEY = PASSWORD
|
16 |
ALGORITHM = 'HS256'
|
17 |
|
18 |
bcrypt_context = CryptContext(schemes=['bcrypt'], deprecated='auto')
|
|
|
21 |
hardcoded_users = [
|
22 |
{ "id": 1,
|
23 |
"username": "test",
|
24 |
+
"password_hash": bcrypt_context.hash(USER_HASH),
|
25 |
"role": "user"
|
26 |
},
|
27 |
|
28 |
{ "id": 2,
|
29 |
"username": "admin",
|
30 |
+
"password_hash": bcrypt_context.hash(ADMIN_HASH),
|
31 |
"role": "admin"
|
32 |
},
|
33 |
|