feat: add GetRandomQuoteAction
This commit is contained in:
parent
50900986fa
commit
75df191253
13 changed files with 185 additions and 218 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import secrets
|
||||
|
||||
from litestar import MediaType, get
|
||||
from litestar.datastructures.cookie import Cookie
|
||||
from litestar.response import Redirect, Template
|
||||
|
||||
from src.huesoporro.actions.authenticate import AuthenticateAction
|
||||
|
|
@ -10,7 +11,16 @@ from src.huesoporro.settings import Settings
|
|||
@get(path="/o/code")
|
||||
async def get_code(code: str, authenticate_action: AuthenticateAction) -> Redirect:
|
||||
token = await authenticate_action.run(code)
|
||||
return Redirect("/", cookies={"huesoporroAuth": token})
|
||||
return Redirect(
|
||||
"/",
|
||||
cookies=[
|
||||
Cookie(
|
||||
key="huesoporroAuth",
|
||||
value=token,
|
||||
expires=604800, # 1 week
|
||||
)
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@get(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue