user route added and coded
can now hit user route (get, post, delete). Coded in some checks to see if user is admin and has privledge. Currently turned off to allow work from curl
This commit is contained in:
@@ -77,10 +77,10 @@ func NewServer(sm *http.ServeMux, clientId, clientSecret, cookieSecret, dbhost,
|
||||
}
|
||||
|
||||
func (s *Server) fakeSetup(w http.ResponseWriter, r *http.Request) {
|
||||
u := userInfo{
|
||||
Email: "derekmcquay@gmail.com",
|
||||
}
|
||||
addUser(u)
|
||||
//u := userInfo{
|
||||
// Email: "derekmcquay@gmail.com",
|
||||
//}
|
||||
//addUser(u)
|
||||
}
|
||||
|
||||
//func (s *Server) tranx(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -265,7 +265,8 @@ func (s *Server) oauthCallback(w http.ResponseWriter, r *http.Request) {
|
||||
if err := session.Save(r, w); err != nil {
|
||||
http.Redirect(w, r, "/", http.StatusTemporaryRedirect)
|
||||
}
|
||||
addUser(u)
|
||||
// TODO add psql user here
|
||||
//addUser(u)
|
||||
http.Redirect(w, r, "/static/", http.StatusTemporaryRedirect)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user