mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-12-18 20:04:17 +01:00
🤖 format everything with pre-commit by stirlingbot (#4175)
Auto-generated by [create-pull-request][1] with **stirlingbot** [1]: https://github.com/peter-evans/create-pull-request Signed-off-by: stirlingbot[bot] <stirlingbot[bot]@users.noreply.github.com> Co-authored-by: stirlingbot[bot] <195170888+stirlingbot[bot]@users.noreply.github.com>
This commit is contained in:
parent
0e70729e38
commit
b5cd301678
@ -71,12 +71,12 @@ export const AppConfigProvider: React.FC<{ children: React.ReactNode }> = ({ chi
|
||||
const isLoginPage = window.location.pathname.includes('/login');
|
||||
const hasJwt = !!localStorage.getItem('stirling_jwt');
|
||||
|
||||
if (isLoginPage && !hasJwt) {
|
||||
console.debug('[AppConfigContext] On login page without JWT - using default config');
|
||||
setConfig({ enableLogin: true });
|
||||
setLoading(false);
|
||||
return;
|
||||
}
|
||||
if (isLoginPage && !hasJwt) {
|
||||
console.debug('[AppConfig] On login page without JWT - using default config');
|
||||
setConfig({ enableLogin: true });
|
||||
setLoading(false);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
setLoading(true);
|
||||
|
||||
@ -9,6 +9,7 @@ function getAuthHeaders(): HeadersInit {
|
||||
|
||||
/**
|
||||
* Hook to check if a specific endpoint is enabled
|
||||
* This wraps the context for single endpoint checks
|
||||
*/
|
||||
export function useEndpointEnabled(endpoint: string): {
|
||||
enabled: boolean | null;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user