( username: string, password: string, config?: Partial<LogtoConfig>, /** * The Accept-Language header value. */ locale?: string )
| 62 | }; |
| 63 | |
| 64 | export const signInAndGetUserApi = async ( |
| 65 | username: string, |
| 66 | password: string, |
| 67 | config?: Partial<LogtoConfig>, |
| 68 | /** |
| 69 | * The Accept-Language header value. |
| 70 | */ |
| 71 | locale?: string |
| 72 | ) => { |
| 73 | const client = await initClientAndSignInForDefaultTenant(username, password, config); |
| 74 | const accessToken = await client.getAccessToken(); |
| 75 | |
| 76 | return baseApi.extend({ |
| 77 | headers: { |
| 78 | Authorization: `Bearer ${accessToken}`, |
| 79 | ...conditional(locale && { 'Accept-Language': locale }), |
| 80 | }, |
| 81 | }); |
| 82 | }; |
no test coverage detected