fix(connector): return error page when error occur

This commit is contained in:
LinkinStars 2023-05-29 15:22:20 +08:00
parent 03eae354f7
commit 20ac2b6c58
1 changed files with 4 additions and 0 deletions

View File

@ -129,6 +129,10 @@ func (cc *ConnectorController) ConnectorRedirect(connector plugin.Connector) (fn
ctx.Redirect(http.StatusFound, "/50x")
return
}
if len(resp.ErrMsg) > 0 {
ctx.Redirect(http.StatusFound, fmt.Sprintf("/50x?title=%s&msg=%s", resp.ErrTitle, resp.ErrMsg))
return
}
if len(resp.AccessToken) > 0 {
ctx.Redirect(http.StatusFound, fmt.Sprintf("%s/users/auth-landing?access_token=%s",
siteGeneral.SiteUrl, resp.AccessToken))