Implement GET /users/email/{email} endpoint for APIv4 (#5309)

* added get user by email endpoint for APIv4

* added get user by email endpoint unit test and driver

* removed the appended return of user ids on logout

* Added RequireEmail to validate user email. Also updated the get user by email endpoint and unit test
This commit is contained in:
Ruzette Tanyag
2017-02-07 11:54:07 -05:00
committed by Christopher Speller
parent 5cc30fa061
commit d91fea6518
6 changed files with 134 additions and 4 deletions

View File

@@ -358,3 +358,16 @@ func (c *Context) RequireChannelId() *Context {
}
return c
}
func (c *Context) RequireEmail() *Context {
if c.Err != nil {
return c
}
pos := strings.Index(c.Params.Email, "@")
if pos < 0 {
c.SetInvalidUrlParam("email")
}
return c
}