Этот коммит содержится в:
Christopher Speller
2016-05-06 12:08:49 -04:00
коммит произвёл Joram Wilander
родитель 204109b4b9
Коммит d2f9fd52fe
4 изменённых файлов: 17 добавлений и 12 удалений

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

@@ -33,6 +33,16 @@ func (me *LogoutProvider) GetCommand(c *Context) *model.Command {
}
func (me *LogoutProvider) DoCommand(c *Context, channelId string, message string) *model.CommandResponse {
FAIL := &model.CommandResponse{ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL, Text: c.T("api.command_logout.fail_message")}
SUCCESS := &model.CommandResponse{GotoLocation: "/", ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL, Text: c.T("api.command_logout.success_message")}
return &model.CommandResponse{GotoLocation: c.GetTeamURL() + "/logout", ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL, Text: c.T("api.command_logout.success_message")}
// 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 c.Session.Id != "" {
RevokeSessionById(c, c.Session.Id)
if c.Err != nil {
return FAIL
}
return SUCCESS
}
return FAIL
}