MM-26055 Remove session requirement from command args. (#14880)

* Remove session requirement from command args.

* Removing unused server side translation.

* Restoring model.CommandArgs.Session for compatibility.

* Feedback fixes.

* Build fix

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Christopher Speller
2020-06-23 08:33:45 -07:00
коммит произвёл GitHub
родитель e7aaf0ea6a
Коммит 574b48835d
23 изменённых файлов: 87 добавлений и 116 удалений

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

@@ -34,15 +34,6 @@ func (me *LogoutProvider) GetCommand(a *App, T goi18n.TranslateFunc) *model.Comm
}
func (me *LogoutProvider) DoCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse {
FAIL := &model.CommandResponse{ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL, Text: args.T("api.command_logout.fail_message")}
SUCCESS := &model.CommandResponse{GotoLocation: "/login"}
// We can't actually remove the user's cookie from here so we just dump their session and let the browser figure it out
if args.Session.Id != "" {
if err := a.RevokeSessionById(args.Session.Id); err != nil {
return FAIL
}
return SUCCESS
}
return FAIL
// Actual logout is handled client side.
return &model.CommandResponse{GotoLocation: "/login"}
}