fix: reserve /oauth for social sign-in
The SPA fallback no longer answers /oauth and the paths below it with index.html, so golem15.sociallogin's start and provider callback routes reach the backend; /oauthy is still a client route.
This commit is contained in:
@@ -116,6 +116,7 @@ func TestStaticReservedPaths(t *testing.T) {
|
||||
"/_presentations", "/_presentations/api/v1/nope",
|
||||
"/bmadmin", "/bmadmin/", "/bmadmin/login", "/storage/app/uploads/public/x.pdf",
|
||||
"/storage", "/_user/../_user/x", "//_bm/api",
|
||||
"/oauth", "/oauth/microsoft", "/oauth/microsoft/callback",
|
||||
} {
|
||||
rec := get(h, http.MethodGet, p, nil)
|
||||
if rec.Code != http.StatusNotFound || strings.Contains(rec.Body.String(), "app") {
|
||||
@@ -123,7 +124,7 @@ func TestStaticReservedPaths(t *testing.T) {
|
||||
}
|
||||
}
|
||||
// Names that merely start like a reserved prefix are client routes.
|
||||
for _, p := range []string{"/bmadmins", "/storage-info", "/_users"} {
|
||||
for _, p := range []string{"/bmadmins", "/storage-info", "/_users", "/oauthy"} {
|
||||
if rec := get(h, http.MethodGet, p, nil); rec.Code != http.StatusOK {
|
||||
t.Fatalf("GET %s = %d, want the fallback", p, rec.Code)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user