Added device location to home screen.
This commit is contained in:
@ -54,6 +54,7 @@ async def login_for_access_token(
|
||||
db.commit()
|
||||
response.set_cookie(key="device_id", value=str(device.id), max_age=10 * 365 * 24 * 60 * 60)
|
||||
response.set_cookie(key="device", value=device.name, max_age=10 * 365 * 24 * 60 * 60)
|
||||
response.set_cookie(key="section", value=device.section.name, max_age=10 * 365 * 24 * 60 * 60)
|
||||
if not allowed:
|
||||
not_allowed_response = JSONResponse(
|
||||
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||
@ -62,6 +63,7 @@ async def login_for_access_token(
|
||||
)
|
||||
not_allowed_response.set_cookie(key="device_id", value=str(device.id), max_age=10 * 365 * 24 * 60 * 60)
|
||||
not_allowed_response.set_cookie(key="device", value=device.name, max_age=10 * 365 * 24 * 60 * 60)
|
||||
not_allowed_response.set_cookie(key="section", value=device.section.name, max_age=10 * 365 * 24 * 60 * 60)
|
||||
return not_allowed_response
|
||||
access_token_expires = timedelta(minutes=settings.JWT_TOKEN_EXPIRE_MINUTES)
|
||||
access_token = create_access_token(
|
||||
|
||||
Reference in New Issue
Block a user