Fixing /logout command (#2908)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
204109b4b9
Коммит
d2f9fd52fe
@@ -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
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user