forked from rilldata/rill
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix auth redirect on the Dashboard page (rilldata#3600)
* Small cleanup * Redirect to login page for all admin server 401s * After login, redirect to previous page
- Loading branch information
1 parent
c1e06a9
commit f9d0ccf
Showing
2 changed files
with
36 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { Query } from "@tanstack/svelte-query"; | ||
|
||
export function isAdminServerQuery(query: Query): boolean { | ||
const [apiPath] = query.queryKey as string[]; | ||
const adminApiEndpoints = [ | ||
"/v1/deployments", | ||
"/v1/github", | ||
"/v1/organizations", | ||
"/v1/projects", | ||
"/v1/services", | ||
"/v1/superuser", | ||
"/v1/telemetry", | ||
"/v1/tokens", | ||
"/v1/users", | ||
]; | ||
|
||
return adminApiEndpoints.some((endpoint) => apiPath.startsWith(endpoint)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters