Skip to content

Commit

Permalink
Fix refresh http only variable (#1493) (#1494)
Browse files Browse the repository at this point in the history
* Fix refresh http only variable (#1493)

* Fix refresh http only variable

* Update version to 0.6.10 in pyproject.toml
  • Loading branch information
ogabrielluiz committed Mar 4, 2024
1 parent 4bec4de commit d59757d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "langflow"
version = "0.6.9"
version = "0.6.10"
description = "A Python package with a built-in web application"
authors = ["Logspace <[email protected]>"]
maintainers = [
Expand Down
9 changes: 6 additions & 3 deletions src/backend/langflow/api/v1/login.py
@@ -1,5 +1,7 @@
from fastapi import APIRouter, Depends, HTTPException, Request, Response, status
from fastapi.security import OAuth2PasswordRequestForm
from sqlmodel import Session

from langflow.api.v1.schemas import Token
from langflow.services.auth.utils import (
authenticate_user,
Expand All @@ -8,7 +10,6 @@
create_user_tokens,
)
from langflow.services.deps import get_session, get_settings_service
from sqlmodel import Session

router = APIRouter(tags=["Login"])

Expand Down Expand Up @@ -85,7 +86,9 @@ async def auto_login(


@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

token = request.cookies.get("refresh_token_lf")
Expand All @@ -95,7 +98,7 @@ async def refresh_token(request: Request, response: Response, settings_service=D
response.set_cookie(
"refresh_token_lf",
tokens["refresh_token"],
httponly=auth_settings.REFRESH_TOKEN_HTTPONLY,
httponly=auth_settings.REFRESH_HTTPONLY,
samesite=auth_settings.REFRESH_SAME_SITE,
secure=auth_settings.REFRESH_SECURE,
)
Expand Down

0 comments on commit d59757d

Please sign in to comment.