mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
[MM-15126] Adding terms of service to the login response (#10625)
This commit is contained in:
committed by
GitHub
parent
12c50eb830
commit
83a0e965d3
11
api4/user.go
11
api4/user.go
@@ -1192,6 +1192,17 @@ func login(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
c.LogAuditWithUserId(user.Id, "success")
|
||||
|
||||
userTermsOfService, err := c.App.GetUserTermsOfService(user.Id)
|
||||
if err != nil && err.StatusCode != http.StatusNotFound {
|
||||
c.Err = err
|
||||
return
|
||||
}
|
||||
|
||||
if userTermsOfService != nil {
|
||||
user.TermsOfServiceId = userTermsOfService.TermsOfServiceId
|
||||
user.TermsOfServiceCreateAt = userTermsOfService.CreateAt
|
||||
}
|
||||
|
||||
c.App.Session = *session
|
||||
|
||||
user.Sanitize(map[string]bool{})
|
||||
|
||||
Reference in New Issue
Block a user