[MM-65015] Restore Mobile redirection on oauth login (#33626) (#33633)

Этот коммит содержится в:
Mattermost Build
2025-08-07 20:47:01 +03:00
коммит произвёл GitHub
родитель 540f4c1145
Коммит e14175eb65
3 изменённых файлов: 21 добавлений и 6 удалений

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

@@ -861,6 +861,7 @@ func (th *TestHelper) AddPermissionToRole(permission string, roleName string) {
func TestFullyQualifiedRedirectURL(t *testing.T) {
const siteURL = "https://xxx.yyy/mm"
for target, expected := range map[string]string{
"": siteURL,
"/": siteURL + "/",
@@ -881,9 +882,11 @@ func TestFullyQualifiedRedirectURL(t *testing.T) {
"https://xxx.yyy/mm/some-path#section": siteURL + "/some-path#section",
"https://xxx.yyy/mm/../malicious-path": siteURL,
":foo": siteURL,
"mmauth://callback": "mmauth://callback",
"mmauth://xxx.yyy/mm": siteURL, // invalid mobile URL (wrong host)
} {
t.Run(target, func(t *testing.T) {
require.Equal(t, expected, fullyQualifiedRedirectURL(siteURL, target))
require.Equal(t, expected, fullyQualifiedRedirectURL(siteURL, target, []string{"mmauth://"}))
})
}
}