Skip to content

Commit

Permalink
[FIX] fastapi_auth_partner: Fix impersonate redirect url
Browse files Browse the repository at this point in the history
  • Loading branch information
paradoxxxzero committed Sep 19, 2024
1 parent b7a14e0 commit 0f695ae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fastapi_auth_partner/routers/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ def impersonate(
.sudo()
._impersonate(endpoint.directory_id, fastapi_partner_id, token)
)
response = RedirectResponse(url="/")
base = endpoint.public_url or (
env["ir.config_parameter"].sudo().get_param("web.base.url") + endpoint.root_path
)
response = RedirectResponse(url=base)
partner_auth._set_auth_cookie(response)
return response

Expand Down

0 comments on commit 0f695ae

Please sign in to comment.