Skip to content

Commit

Permalink
fix: handle redirect_path corner case in oauth_controller.go
Browse files Browse the repository at this point in the history
  • Loading branch information
peterxcli committed Jan 23, 2024
1 parent 7c68a76 commit 2f473a2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/controller/oauth_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ type OAuthController struct {
// @Failure 400 {string} string "Bad Request"
// @Router /line-login/auth [get]
func (ctrl *OAuthController) LineLogin(c *gin.Context) {
originalUrl := c.Request.Referer() + c.Query("redirect_path")[1:]
redirectedPath := c.Query("redirect_path")
originalUrl := c.Request.Referer()
if len(redirectedPath) != 0 {
originalUrl += redirectedPath[1:]
}

log.Println("originalUrl:", originalUrl)
serverURL := ctrl.env.Line.ServerUrl
Expand Down

0 comments on commit 2f473a2

Please sign in to comment.