summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorenahum <nahumhbl@gmail.com>2016-10-17 11:43:28 -0300
committerJoram Wilander <jwawilander@gmail.com>2016-10-17 10:43:28 -0400
commit38568c2769d08809474ec2f49719abe7dca7cbbc (patch)
tree1bf1dbaa4dbe5e40159cb7745277e77580ff5982
parent6cb0652c3dc123215ff7ec5f5882e8ca8d170693 (diff)
downloadchat-38568c2769d08809474ec2f49719abe7dca7cbbc.tar.gz
chat-38568c2769d08809474ec2f49719abe7dca7cbbc.tar.bz2
chat-38568c2769d08809474ec2f49719abe7dca7cbbc.zip
PLT-3968 Require user for getMe API (#4225)
-rw-r--r--api/user.go6
1 files changed, 1 insertions, 5 deletions
diff --git a/api/user.go b/api/user.go
index ae8136d7a..5f7e3ad10 100644
--- a/api/user.go
+++ b/api/user.go
@@ -51,7 +51,7 @@ func InitUser() {
BaseRoutes.Users.Handle("/verify_email", ApiAppHandler(verifyEmail)).Methods("POST")
BaseRoutes.Users.Handle("/resend_verification", ApiAppHandler(resendVerification)).Methods("POST")
BaseRoutes.Users.Handle("/newimage", ApiUserRequired(uploadProfileImage)).Methods("POST")
- BaseRoutes.Users.Handle("/me", ApiAppHandler(getMe)).Methods("GET")
+ BaseRoutes.Users.Handle("/me", ApiUserRequired(getMe)).Methods("GET")
BaseRoutes.Users.Handle("/initial_load", ApiAppHandler(getInitialLoad)).Methods("GET")
BaseRoutes.Users.Handle("/direct_profiles", ApiUserRequired(getDirectProfiles)).Methods("GET")
BaseRoutes.Users.Handle("/profiles/{id:[A-Za-z0-9]+}", ApiUserRequired(getProfiles)).Methods("GET")
@@ -843,10 +843,6 @@ func Logout(c *Context, w http.ResponseWriter, r *http.Request) {
func getMe(c *Context, w http.ResponseWriter, r *http.Request) {
- if len(c.Session.UserId) == 0 {
- return
- }
-
if result := <-Srv.Store.User().Get(c.Session.UserId); result.Err != nil {
c.Err = result.Err
c.RemoveSessionCookie(w, r)