feat: setup for setting first password

This commit is contained in:
2025-03-11 08:12:29 +01:00
parent a37971ed86
commit 045c26d258
4 changed files with 78 additions and 22 deletions

View File

@@ -189,9 +189,14 @@ async def logout(response: Response):
def generate_one_time_token(username):
expire = timedelta(days=7)
token = create_access_token(data={"sub": username}, expires_delta=expire)
return token
user = get_user(username)
if user:
expire = timedelta(days=7)
token = create_access_token(
data={"sub": username, "name": user.display_name},
expires_delta=expire,
)
return token
class FirstPassword(BaseModel):