From e972a5ea01cc1c3af3a7c18aa80915930cf3d481 Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Sat, 11 Feb 2023 05:31:25 +0200 Subject: [PATCH] tuitio token fix --- src/__tests__/TuitioAuthentication.test.ts | 2 ++ src/client.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/__tests__/TuitioAuthentication.test.ts b/src/__tests__/TuitioAuthentication.test.ts index 6c4fcc1..54a3415 100644 --- a/src/__tests__/TuitioAuthentication.test.ts +++ b/src/__tests__/TuitioAuthentication.test.ts @@ -24,10 +24,12 @@ test("Tuitio client authentication", async () => { expect(result.status).toBe("_MOCK_"); const storage = fetch(); + expect(storage.token.raw).toBe("mock-user-pass"); expect(storage.userName).toBe("user"); invalidate(); const emptyStorage = fetch(); + expect(emptyStorage.token).toBeNull(); expect(emptyStorage.userName).toBeNull(); }); diff --git a/src/client.ts b/src/client.ts index 6fdc5b0..3987bc9 100644 --- a/src/client.ts +++ b/src/client.ts @@ -53,7 +53,7 @@ const invalidate = (): void => { } }; -export type TuitioState = { token: string; userName: string }; +export type TuitioState = { token: TuitioToken; userName: string }; const fetch = (): TuitioState => { const data = {