Skip to content

Commit fc253c2

Browse files
committed
compatible with newer golang/oauth2
- martini-contrib/oauth#36
1 parent 0064bd8 commit fc253c2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

authenticator.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ type GoogleAuth struct {
6565
}
6666

6767
func (a *GoogleAuth) Authenticate(domain []string, c martini.Context, tokens oauth2.Tokens, w http.ResponseWriter, r *http.Request) {
68-
extra := tokens.ExtraData()
69-
if _, ok := extra["id_token"]; ok == false {
68+
idToken := tokens.Extra("id_token")
69+
if len(idToken) == 0 {
7070
log.Printf("id_token not found")
7171
forbidden(w)
7272
return
7373
}
7474

75-
keys := strings.Split(extra["id_token"], ".")
75+
keys := strings.Split(idToken, ".")
7676
if len(keys) < 2 {
7777
log.Printf("invalid id_token")
7878
forbidden(w)

0 commit comments

Comments
 (0)