Skip to content

Commit

Permalink
fix verified roles examples
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 committed Apr 10, 2023
1 parent 250d1c9 commit a50f1ef
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions _examples/verified_roles/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ func handleCallback(w http.ResponseWriter, r *http.Request) {
state = query.Get("state")
)
if code != "" && state != "" {
identifier := randStr(32)
session, err := oAuth2Client.StartSession(code, state, identifier)
session, _, err := oAuth2Client.StartSession(code, state)
if err != nil {
writeError(w, "error while starting session", err)
return
Expand Down Expand Up @@ -104,11 +103,3 @@ func writeError(w http.ResponseWriter, text string, err error) {
w.WriteHeader(http.StatusInternalServerError)
_, _ = w.Write([]byte(text + ": " + err.Error()))
}

func randStr(n int) string {
b := make([]rune, n)
for i := range b {
b[i] = letters[rand.Intn(len(letters))]
}
return string(b)
}

0 comments on commit a50f1ef

Please sign in to comment.