feat: revamp authentication -- remove twitch's tokens from our own wrapper token

This commit is contained in:
cătălin 2025-01-17 18:15:58 +01:00
commit 50900986fa
No known key found for this signature in database
31 changed files with 736 additions and 155 deletions

View file

@ -3,14 +3,14 @@ import secrets
from litestar import MediaType, get
from litestar.response import Redirect, Template
from src.huesoporro.actions.authenticate import AuthenticateAction
from src.huesoporro.settings import Settings
from src.huesoporro.svc.authenticate import CodeAuthenticatorSvc
@get(path="/o/code")
async def get_code(code: str, code_authenticator_svc: CodeAuthenticatorSvc) -> Redirect:
user = await code_authenticator_svc.run(code)
return Redirect("/", cookies={"huesoporroAuth": user.encode()})
async def get_code(code: str, authenticate_action: AuthenticateAction) -> Redirect:
token = await authenticate_action.run(code)
return Redirect("/", cookies={"huesoporroAuth": token})
@get(