So this one's been puzzling me for a little while!
Here's some code in the console:
func GetLoginLinks(w *http.ResponseWriter, r *http.Request) (string, error) {
c := appengine.NewContext(r)
u := user.Current(c)
if u == nil {
url, err := user.LoginURL(c, r.URL.String())
if err != nil {
http.Error(*w, err.Error(), http.StatusInternalServerError)
return "", err
}
c.Debugf("Return url: " + r.URL.String())
c.Debugf("login url: " + url)
c.Debugf("url type: %T", url)
v := LoginItem(url, "Login")
return v, nil
}
}
It gives the following output:
2013/06/17 21:48:28 DEBUG: Return url: /
2013/06/17 21:48:28 DEBUG: login url: /_ah/login?continue=http%A(MISSING)//localhost%A(MISSING)8080/
2013/06/17 21:48:28 DEBUG: url type: string
This also fails when uploaded to the app engine itself.
What I'm struggling with is the first 4 lines of the function comes directly from the developer guide.