diff --git a/.gitea/workflows/test-build-only.yml b/.gitea/workflows/test-build-only.yml new file mode 100644 index 0000000..fb73e32 --- /dev/null +++ b/.gitea/workflows/test-build-only.yml @@ -0,0 +1,12 @@ +name: Test Build Only (temporary, no push) + +on: + workflow_dispatch: + +jobs: + build: + runs-on: linux + steps: + - uses: actions/checkout@v4 + - name: Docker build (no push) + run: docker build -t materialschein-test:local . diff --git a/client/src/lib/authConfig.ts b/client/src/lib/authConfig.ts index 525c1db..c3a850b 100644 --- a/client/src/lib/authConfig.ts +++ b/client/src/lib/authConfig.ts @@ -12,7 +12,9 @@ const msalConfig: Configuration = { redirectUri: window.location.origin }, cache: { - cacheLocation: 'sessionStorage' + // localStorage statt sessionStorage: bleibt erhalten, wenn die (installierte) App + // geschlossen und neu gestartet wird – sonst müsste man sich jedes Mal neu anmelden. + cacheLocation: 'localStorage' } }; diff --git a/client/src/lib/localAuth.ts b/client/src/lib/localAuth.ts index 112cf20..c3c8995 100644 --- a/client/src/lib/localAuth.ts +++ b/client/src/lib/localAuth.ts @@ -1,12 +1,14 @@ const TOKEN_KEY = 'bv_local_token'; const NAME_KEY = 'bv_local_name'; +// localStorage statt sessionStorage: bleibt erhalten, wenn die (installierte) App +// geschlossen und neu gestartet wird – das Token ist 30 Tage gültig (siehe routes/auth.ts). export function getLocalToken(): string | null { - return sessionStorage.getItem(TOKEN_KEY); + return localStorage.getItem(TOKEN_KEY); } export function getLocalUser(): string | null { - return sessionStorage.getItem(NAME_KEY); + return localStorage.getItem(NAME_KEY); } export async function localLogin(username: string, password: string): Promise { @@ -20,12 +22,12 @@ export async function localLogin(username: string, password: string): Promise