Merge pull request #2373 from mattermost/PLT-1988
PLT-1988 fixing slash logout
Этот коммит содержится в:
@@ -33,5 +33,6 @@ func (me *LogoutProvider) GetCommand(c *Context) *model.Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (me *LogoutProvider) DoCommand(c *Context, channelId string, message string) *model.CommandResponse {
|
func (me *LogoutProvider) DoCommand(c *Context, channelId string, message string) *model.CommandResponse {
|
||||||
return &model.CommandResponse{GotoLocation: "/logout", 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")}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
package api
|
package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/mattermost/platform/model"
|
"github.com/mattermost/platform/model"
|
||||||
@@ -26,7 +27,7 @@ func TestLogoutTestCommand(t *testing.T) {
|
|||||||
channel1 = Client.Must(Client.CreateChannel(channel1)).Data.(*model.Channel)
|
channel1 = Client.Must(Client.CreateChannel(channel1)).Data.(*model.Channel)
|
||||||
|
|
||||||
rs1 := Client.Must(Client.Command(channel1.Id, "/logout", false)).Data.(*model.CommandResponse)
|
rs1 := Client.Must(Client.Command(channel1.Id, "/logout", false)).Data.(*model.CommandResponse)
|
||||||
if rs1.GotoLocation != "/logout" {
|
if !strings.HasSuffix(rs1.GotoLocation, "logout") {
|
||||||
t.Fatal("failed to logout")
|
t.Fatal("failed to logout")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user