Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
loathedrobot committed Sep 21, 2023
1 parent ffec2cd commit 1dfcd81
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/oauth2/handlers/bitrix.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@ func (g *BitrixOauthHandler) Setup(log *zap.Logger, router *mux.Router, cfg conf
g.m.Unlock()

url := oauth2Config.AuthCodeURL(state)
http.Redirect(w, r, url, http.StatusTemporaryRedirect)

result := map[string]string{
"url": url,
}

marshal, _ := json.Marshal(result)
w.Write(marshal)
}))
router.Handle("/oauth/bitrix/checkout", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
state, code := r.FormValue("state"), r.FormValue("code")
Expand Down

0 comments on commit 1dfcd81

Please sign in to comment.