feat(auth): Add OAuth2 authentication
This commit is contained in:
10
secnex/utils/secret.py
Normal file
10
secnex/utils/secret.py
Normal file
@@ -0,0 +1,10 @@
|
||||
import secrets
|
||||
|
||||
from argon2 import PasswordHasher
|
||||
|
||||
def generate_secret(length: int = 32) -> str:
|
||||
return secrets.token_hex(length)
|
||||
|
||||
def hash_secret(secret: str) -> str:
|
||||
ph = PasswordHasher()
|
||||
return ph.hash(secret)
|
||||
Reference in New Issue
Block a user