My site uses the built-in login system to get to the page, like this:
func handler(w http.ResponseWriter, r *http.Request) {
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
}
w.Header().Set("Location", url)
w.WriteHeader(http.StatusFound)
return
}
fmt.Fprintf(w, "Hello, %v!", u)
}
How do I include that user info when doing an XMLHttpRequest from that page
to a different url handled by the same GAE app?
I want to make sure that only logged in users have access to the url used
for the XMLHttpRequest.
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-appengine/9dd8b8e3-aa64-4fce-95ca-e76b42d1d127%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.