fix: Add multiple verbose debugging
This commit is contained in:
parent
98d2a6c3b2
commit
d6148f289a
@ -30,7 +30,12 @@ var config = oauth2.Config{
|
|||||||
var sessionStore = sessions.NewCookieStore([]byte("xDDBjhYwyndZty3exGNq2ahE8wHRCR4DfdCJCSoWXAYncfWw2UQDH63QcJ9CkrGx"))
|
var sessionStore = sessions.NewCookieStore([]byte("xDDBjhYwyndZty3exGNq2ahE8wHRCR4DfdCJCSoWXAYncfWw2UQDH63QcJ9CkrGx"))
|
||||||
|
|
||||||
func rootHandler(w http.ResponseWriter, r *http.Request) {
|
func rootHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
session, _ := sessionStore.Get(r, "spamasaurusRex")
|
session, err := sessionStore.Get(r, "spamasaurusRex")
|
||||||
|
if err != nil {
|
||||||
|
log.Println(spew.Sdump(err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if token, ok := session.Values["token"]; ok {
|
if token, ok := session.Values["token"]; ok {
|
||||||
log.Println(spew.Sdump(token))
|
log.Println(spew.Sdump(token))
|
||||||
w.Write([]byte("Token retrieved from session"))
|
w.Write([]byte("Token retrieved from session"))
|
||||||
@ -59,7 +64,12 @@ func callbackHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
session.Values["token"] = token
|
session.Values["token"] = token
|
||||||
session.Save(r, w)
|
|
||||||
|
err = session.Save(r, w)
|
||||||
|
if err != nil {
|
||||||
|
log.Println(spew.Sdump(err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
log.Println(spew.Sdump(session))
|
log.Println(spew.Sdump(session))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user