Hello all,
I just upgraded my SDK to version 1.7.6 and I am running into an issue when trying to preform a check to see if a user is logged in or not. Below is my function for directing the user to where they can sign in with a Google account.
func login(w http.ResponseWriter, r *http.Request) {
c := appengine.NewContext(r)
u := user.Current(c)
if u == nil {
url, err := user.LoginURL(c, "")
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
w.Header().Set("Location", url)
w.WriteHeader(http.StatusFound)
}
return
}
When this function is called the following error is displayed in the browser
the error in the dev server is not that much helpful ether
INFO 2013-03-20 23:25:21,242 server.py:528] "GET /login HTTP/1.1" 500 45
When I open the localhost:41791 in my browser I see that it returns JSON, but what it returns does not look valid
{app_id: dev~mark-keep, rtok: '0'}
When I run that through a JSON lint checker I get the following error
Parse error on line 1:
{ app_id: dev~mark-kee
-----^
Expecting 'STRING', '}'