Skip to content
Snippets Groups Projects
Commit 66e7b9dd authored by Hugo NOUTS's avatar Hugo NOUTS
Browse files

added some changes related to the advices i gathered from cozy forum

parent 5f8650d5
Branches
No related tags found
No related merge requests found
Pipeline #4926 passed
......@@ -19,15 +19,15 @@ func main() {
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
query := r.URL.Query()
fmt.Println(query)
host := strings.Split(query.Get("state"), "-")[0]
host := strings.Split(query.Get("state"), "-")[1]
fmt.Println(host)
state := query.Get("state")
state := strings.Split(query.Get("state"), "-")[0]
fmt.Println(state)
usagePointId := query.Get("usage_point_id")
fmt.Println(usagePointId)
code := query.Get("code")
fmt.Println(code)
redir := "http://" + host + "?code=" + code + "?state="+ state +"&usage_point_id=" + usagePointId
redir := "https://" + host + "?code=" + code + "&state="+ state +"&usage_point_id=" + usagePointId
fmt.Println(redir)
http.Redirect(w, r, redir, 302)
})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment