Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix refresh http only variable (#1493) #1494

Merged
merged 3 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.9"
version = "0.6.10"
description = "A Python package with a built-in web application"
authors = ["Logspace <contact@logspace.ai>"]
maintainers = [
Expand Down
9 changes: 6 additions & 3 deletions src/backend/langflow/api/v1/login.py
Original file line number Diff line number Diff line change
@@ -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