Skip to content

Commit

Permalink
chore: add redirect_url info to log
Browse files Browse the repository at this point in the history
  • Loading branch information
zensh committed Sep 21, 2023
1 parent e9ad642 commit 3acae18
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/api/authn.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ func (a *AuthN) Login(ctx *gear.Context) error {
reqUrl.Path = "/idp/wechat_h5/authorize"
}
reqUrl.RawQuery = strings.Replace(ctx.Req.URL.RawQuery, a.cookie.Domain, a.cookie.WeChatDomain, 1)
return ctx.Redirect(reqUrl.String())
next := reqUrl.String()
logging.SetTo(ctx, "redirect_url", next)
return ctx.Redirect(next)
}
}

Expand Down Expand Up @@ -299,11 +301,12 @@ func (a *AuthN) Callback(ctx *gear.Context) error {
Path: "/sync_session",
RawQuery: "sess=" + base64.RawURLEncoding.EncodeToString(data),
}
return ctx.Redirect(reqUrl.String())
next = reqUrl.String()
}
}
}

logging.SetTo(ctx, "redirect_url", next)
return ctx.Redirect(next)
}

Expand Down Expand Up @@ -351,6 +354,7 @@ func (a *AuthN) SyncSession(ctx *gear.Context) error {
}

http.SetCookie(ctx.Res, sessCookie)
logging.SetTo(ctx, "redirect_url", next)
return ctx.Redirect(next)
}

Expand Down

0 comments on commit 3acae18

Please sign in to comment.