add reset password endpoint
This commit is contained in:
@@ -16,9 +16,9 @@ from passlib.hash import pbkdf2_sha256
|
||||
from pydantic import UUID4, EmailStr
|
||||
|
||||
from boto3clients import dynamodb_client
|
||||
from config import SESSION_EXPIRES_IN, USER_TABLE
|
||||
from config import USER_TABLE
|
||||
|
||||
from .authentication import new_session
|
||||
from .authentication import cookie
|
||||
|
||||
router = Router()
|
||||
dyn = DynamoDBPersistenceLayer(USER_TABLE, dynamodb_client)
|
||||
@@ -74,7 +74,7 @@ def register(
|
||||
compress=True,
|
||||
body=asdict(new_user),
|
||||
cookies=[
|
||||
_cookie(existing['id']),
|
||||
cookie(existing['id']),
|
||||
],
|
||||
)
|
||||
|
||||
@@ -86,22 +86,11 @@ def register(
|
||||
compress=True,
|
||||
body=asdict(new_user),
|
||||
cookies=[
|
||||
_cookie(new_user.id),
|
||||
cookie(new_user.id),
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
def _cookie(user_id: str) -> Cookie:
|
||||
return Cookie(
|
||||
name='SID',
|
||||
value=new_session(user_id),
|
||||
http_only=True,
|
||||
secure=True,
|
||||
same_site=None,
|
||||
max_age=SESSION_EXPIRES_IN,
|
||||
)
|
||||
|
||||
|
||||
def _create_user(*, user: User, password: str):
|
||||
now_ = now()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user