Skip to content

Commit

Permalink
Refactor import order and remove unnecessary samesite attribute in se…
Browse files Browse the repository at this point in the history
…t_cookie() calls (#1370)

This pull request refactors the import order and removes the unnecessary samesite attribute in the set_cookie() calls. This change improves the code readability and removes redundant code.
  • Loading branch information
ogabrielluiz authored Jan 26, 2024
2 parents fc7bcf5 + a2ca8a6 commit eece7b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "langflow"
version = "0.6.5a10"
version = "0.6.5a11"
description = "A Python package with a built-in web application"
authors = ["Logspace <[email protected]>"]
maintainers = [
Expand Down
6 changes: 3 additions & 3 deletions src/backend/langflow/api/v1/login.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from fastapi import Request, Response, APIRouter, Depends, HTTPException, status
from fastapi import APIRouter, Depends, HTTPException, Request, Response, status
from fastapi.security import OAuth2PasswordRequestForm
from sqlmodel import Session

Expand Down Expand Up @@ -33,8 +33,8 @@ async def login_to_get_access_token(

if user:
tokens = create_user_tokens(user_id=user.id, db=db, update_last_login=True)
response.set_cookie("refresh_token_lf", tokens["refresh_token"], httponly=True, secure=True, samesite="strict")
response.set_cookie("access_token_lf", tokens["access_token"], httponly=False, secure=True, samesite="strict")
response.set_cookie("refresh_token_lf", tokens["refresh_token"], httponly=True, secure=True)
response.set_cookie("access_token_lf", tokens["access_token"], httponly=False, secure=True)
return tokens
else:
raise HTTPException(
Expand Down

0 comments on commit eece7b6

Please sign in to comment.