Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions adminforth/modules/restApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI {


if (!userRecord) {
response.setStatus(401);
return { error: INVALID_MESSAGE };
}

Expand Down Expand Up @@ -748,6 +749,7 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI {
});
}
} else {
response.setStatus(401);
return { error: INVALID_MESSAGE };
}

Expand Down
2 changes: 1 addition & 1 deletion adminforth/spa/src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export async function callApi({path, method, body, headers, silentError = false,
const fullPath = `${import.meta.env.VITE_ADMINFORTH_PUBLIC_PATH || ''}${path}`;
try {
const r = await fetch(fullPath, options);
if (r.status == 401 ) {
if (r.status == 401 && !path.includes('/login')) {
useUserStore().unauthorize();
useCoreStore().resetAdminUser();
await redirectToLogin();
Expand Down
2 changes: 1 addition & 1 deletion adminforth/types/Back.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export interface IConfigValidator {

export interface IAdminForthHttpResponse {
setHeader: (key: string, value: string) => void,
setStatus: (code: number, message: string) => void,
setStatus: (code: number, message?: string) => void,
blobStream: () => Writable,
};

Expand Down