mirror of
https://github.com/rommapp/romm.git
synced 2026-12-03 10:33:22 +01:00
small fixes
This commit is contained in:
@@ -47,7 +47,7 @@ class AuthHandler:
|
||||
def __init__(self) -> None:
|
||||
self.pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
|
||||
|
||||
def _verify_password(self, plain_password, hashed_password):
|
||||
def verify_password(self, plain_password, hashed_password):
|
||||
return self.pwd_context.verify(plain_password, hashed_password)
|
||||
|
||||
def get_password_hash(self, password):
|
||||
@@ -67,7 +67,7 @@ class AuthHandler:
|
||||
if not user:
|
||||
return None
|
||||
|
||||
if not self._verify_password(password, user.hashed_password):
|
||||
if not self.verify_password(password, user.hashed_password):
|
||||
return None
|
||||
|
||||
return user
|
||||
|
||||
@@ -10,8 +10,8 @@ from handler.redis_handler import cache
|
||||
|
||||
|
||||
def test_verify_password():
|
||||
assert authh._verify_password("password", authh.get_password_hash("password"))
|
||||
assert not authh._verify_password("password", authh.get_password_hash("notpassword"))
|
||||
assert authh.verify_password("password", authh.get_password_hash("password"))
|
||||
assert not authh.verify_password("password", authh.get_password_hash("notpassword"))
|
||||
|
||||
|
||||
def test_authenticate_user(admin_user):
|
||||
@@ -94,7 +94,7 @@ def test_create_default_admin_user():
|
||||
|
||||
user = dbuserh.get_user_by_username("test_admin")
|
||||
assert user.username == "test_admin"
|
||||
assert authh._verify_password("test_admin_password", user.hashed_password)
|
||||
assert authh.verify_password("test_admin_password", user.hashed_password)
|
||||
|
||||
users = dbuserh.get_users()
|
||||
assert len(users) == 1
|
||||
|
||||
2
frontend/src/__generated__/index.ts
generated
2
frontend/src/__generated__/index.ts
generated
@@ -7,7 +7,7 @@ export type { AddRomsResponse } from './models/AddRomsResponse';
|
||||
export type { Body_add_roms_roms_post } from './models/Body_add_roms_roms_post';
|
||||
export type { Body_add_saves_saves_post } from './models/Body_add_saves_saves_post';
|
||||
export type { Body_add_states_states_post } from './models/Body_add_states_states_post';
|
||||
export type { Body_token_token_get } from './models/Body_token_token_get';
|
||||
export type { Body_token_token_post } from './models/Body_token_token_post';
|
||||
export type { Body_update_rom_roms__id__put } from './models/Body_update_rom_roms__id__put';
|
||||
export type { Body_update_user_users__id__put } from './models/Body_update_user_users__id__put';
|
||||
export type { ConfigResponse } from './models/ConfigResponse';
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
export type Body_token_token_get = {
|
||||
export type Body_token_token_post = {
|
||||
grant_type?: string;
|
||||
scope?: string;
|
||||
username?: (string | null);
|
||||
Reference in New Issue
Block a user