Fix refresh http only variable (#1493) (#1494)

* Fix refresh http only variable (#1493)

* Fix refresh http only variable

* Update version to 0.6.10 in pyproject.toml
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-03-04 08:46:39 -03:00 • committed by GitHub
commit d59757d82f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 4 deletions

View file

@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "langflow" name = "langflow"
version = "0.6.9" version = "0.6.10"
description = "A Python package with a built-in web application" description = "A Python package with a built-in web application"
authors = ["Logspace <contact@logspace.ai>"] authors = ["Logspace <contact@logspace.ai>"]
maintainers = [ maintainers = [

View file

@ -1,5 +1,7 @@
from fastapi import APIRouter, Depends, HTTPException, Request, Response, status from fastapi import APIRouter, Depends, HTTPException, Request, Response, status
from fastapi.security import OAuth2PasswordRequestForm from fastapi.security import OAuth2PasswordRequestForm
from sqlmodel import Session
from langflow.api.v1.schemas import Token from langflow.api.v1.schemas import Token
from langflow.services.auth.utils import ( from langflow.services.auth.utils import (
authenticate_user, authenticate_user,
@ -8,7 +10,6 @@ from langflow.services.auth.utils import (
create_user_tokens, create_user_tokens,
) )
from langflow.services.deps import get_session, get_settings_service from langflow.services.deps import get_session, get_settings_service
from sqlmodel import Session
router = APIRouter(tags=["Login"]) router = APIRouter(tags=["Login"])
@ -85,7 +86,9 @@ async def auto_login(
@router.post("/refresh") @router.post("/refresh")
async def refresh_token(request: Request, response: Response, settings_service=Depends(get_settings_service)): async def refresh_token(
request: Request, response: Response, settings_service=Depends(get_settings_service)
):
auth_settings = settings_service.auth_settings auth_settings = settings_service.auth_settings
token = request.cookies.get("refresh_token_lf") token = request.cookies.get("refresh_token_lf")
@ -95,7 +98,7 @@ async def refresh_token(request: Request, response: Response, settings_service=D
response.set_cookie( response.set_cookie(
"refresh_token_lf", "refresh_token_lf",
tokens["refresh_token"], tokens["refresh_token"],
httponly=auth_settings.REFRESH_TOKEN_HTTPONLY, httponly=auth_settings.REFRESH_HTTPONLY,
samesite=auth_settings.REFRESH_SAME_SITE, samesite=auth_settings.REFRESH_SAME_SITE,
secure=auth_settings.REFRESH_SECURE, secure=auth_settings.REFRESH_SECURE,
) )