subpath feature
This commit is contained in:
1 parent
2d668b3fb8
commit
076efc2101
11 files changed
+32
-31
No files matched your search
@@ -122,7 +122,7 @@ export function login(
|
||||
password: string,
|
||||
fetchFn: FetchLike = defaultFetch,
|
||||
): Promise<AuthUser> {
|
||||
return requestUser(fetchFn, "/api/auth/login", { username, password });
|
||||
return requestUser(fetchFn, "api/auth/login", { username, password });
|
||||
}
|
||||
|
||||
/** POST /api/auth/register → user (auto signed in), or throws (400/409). */
|
||||
@@ -131,7 +131,7 @@ export function register(
|
||||
password: string,
|
||||
fetchFn: FetchLike = defaultFetch,
|
||||
): Promise<AuthUser> {
|
||||
return requestUser(fetchFn, "/api/auth/register", { username, password });
|
||||
return requestUser(fetchFn, "api/auth/register", { username, password });
|
||||
}
|
||||
|
||||
/** Result of the startup /me probe (fetchAuthStatus). */
|
||||
@@ -158,7 +158,7 @@ export async function fetchAuthStatus(
|
||||
fetchFn: FetchLike = defaultFetch,
|
||||
): Promise<AuthStatus> {
|
||||
try {
|
||||
const response = await fetchFn("/api/auth/me", {
|
||||
const response = await fetchFn("api/auth/me", {
|
||||
method: "GET",
|
||||
credentials: "same-origin",
|
||||
});
|
||||
@@ -179,7 +179,7 @@ export async function fetchAuthStatus(
|
||||
*/
|
||||
export async function logout(fetchFn: FetchLike = defaultFetch): Promise<void> {
|
||||
try {
|
||||
await fetchFn("/api/auth/logout", {
|
||||
await fetchFn("api/auth/logout", {
|
||||
method: "POST",
|
||||
credentials: "same-origin",
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user