MM-54182 - add correct information to session table from mobile devices (#24353)

* MM-54182 - add correct information to session table from mobile devices

* improve comments around helper function

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Pablo Andrés Vélez Vidal
2023-09-01 14:25:07 +02:00
коммит произвёл GitHub
родитель 8c2fc88471
Коммит 4f0f3845e4
5 изменённых файлов: 67 добавлений и 4 удалений

Просмотреть файл

@@ -1950,7 +1950,8 @@ func login(c *Context, w http.ResponseWriter, r *http.Request) {
c.LogAuditWithUserId(user.Id, "authenticated")
err = c.App.DoLogin(c.AppContext, w, r, user, deviceId, false, false, false)
isMobileDevice := utils.IsMobileRequest(r)
err = c.App.DoLogin(c.AppContext, w, r, user, deviceId, isMobileDevice, false, false)
if err != nil {
c.Err = err
return
@@ -2044,7 +2045,8 @@ func loginCWS(c *Context, w http.ResponseWriter, r *http.Request) {
}
audit.AddEventParameterAuditable(auditRec, "user", user)
c.LogAuditWithUserId(user.Id, "authenticated")
err = c.App.DoLogin(c.AppContext, w, r, user, "", false, false, false)
isMobileDevice := utils.IsMobileRequest(r)
err = c.App.DoLogin(c.AppContext, w, r, user, "", isMobileDevice, false, false)
if err != nil {
c.LogErrorByCode(err)
http.Redirect(w, r, *c.App.Config().ServiceSettings.SiteURL, http.StatusFound)