Add GetBaseFrontendUrl() to remove duplication (#1506)

This commit is contained in:
Matjaž Lipuš 2025-07-16 18:49:23 +02:00 committed by GitHub
parent e1d9c7963e
commit 6eec16a57f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 8 deletions

View file

@ -113,10 +113,7 @@ func (albyHttpSvc *AlbyHttpService) albyCallbackHandler(c echo.Context) error {
return c.NoContent(http.StatusNoContent)
}
redirectUrl := albyHttpSvc.appConfig.FrontendUrl
if redirectUrl == "" {
redirectUrl = albyHttpSvc.appConfig.BaseUrl
}
redirectUrl := albyHttpSvc.appConfig.GetBaseFrontendUrl()
if redirectUrl == "" {
// OAuth using a custom client requires a base URL set for the callback

View file

@ -1190,10 +1190,7 @@ func (httpSvc *HttpService) execCustomNodeCommandHandler(c echo.Context) error {
}
func (httpSvc *HttpService) logoutHandler(c echo.Context) error {
redirectUrl := httpSvc.cfg.GetEnv().FrontendUrl
if redirectUrl == "" {
redirectUrl = httpSvc.cfg.GetEnv().BaseUrl
}
redirectUrl := httpSvc.cfg.GetEnv().GetBaseFrontendUrl()
if redirectUrl == "" {
redirectUrl = "/"
}