mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
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:
committed by
Christopher Speller
parent
5cc30fa061
commit
d91fea6518
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user