Skip to content

Commit 0f695ae

Browse files
committed
[FIX] fastapi_auth_partner: Fix impersonate redirect url
1 parent b7a14e0 commit 0f695ae

File tree

1 file changed

+4
-1
lines changed
  • fastapi_auth_partner/routers

1 file changed

+4
-1
lines changed

fastapi_auth_partner/routers/auth.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ def impersonate(
120120
.sudo()
121121
._impersonate(endpoint.directory_id, fastapi_partner_id, token)
122122
)
123-
response = RedirectResponse(url="/")
123+
base = endpoint.public_url or (
124+
env["ir.config_parameter"].sudo().get_param("web.base.url") + endpoint.root_path
125+
)
126+
response = RedirectResponse(url=base)
124127
partner_auth._set_auth_cookie(response)
125128
return response
126129

0 commit comments

Comments
 (0)