diff options
Diffstat (limited to 'packages/demobank-ui/src/hooks/useCredentialsChecker.ts')
-rw-r--r-- | packages/demobank-ui/src/hooks/useCredentialsChecker.ts | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/packages/demobank-ui/src/hooks/useCredentialsChecker.ts b/packages/demobank-ui/src/hooks/useCredentialsChecker.ts index b76754ffe..05954348f 100644 --- a/packages/demobank-ui/src/hooks/useCredentialsChecker.ts +++ b/packages/demobank-ui/src/hooks/useCredentialsChecker.ts @@ -9,20 +9,25 @@ export function useCredentialsChecker() { //while merchant backend doesn't have a login endpoint async function requestNewLoginToken( username: string, - password: AccessToken, + password: string, ): Promise<LoginResult> { const data: LoginTokenRequest = { - scope: "write", + scope: "readwrite" as "write", //FIX: different than merchant duration: { - d_us: "forever" + // d_us: "forever" //FIX: should return shortest + d_us: 1000 * 60 * 60 * 23 }, refreshable: true, } try { const response = await request<LoginTokenSuccessResponse>(baseUrl, `accounts/${username}/token`, { method: "POST", - token: password, - data + basicAuth: { + username: username, + password, + }, + data, + contentType: "json" }); return { valid: true, token: response.data.token, expiration: response.data.expiration }; } catch (error) { |