mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-22 14:25:47 +00:00
feat: refresh user session
This commit is contained in:
@@ -18,6 +18,21 @@ export class AuthApiService {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
async refresh() {
|
||||
try {
|
||||
const refreshRes = await httpClient<BaseApiResponse>(`/sso/refresh`, {
|
||||
method: 'POST',
|
||||
});
|
||||
|
||||
return refreshRes;
|
||||
} catch (error) {
|
||||
if (axios.isAxiosError<BaseApiResponse>(error)) {
|
||||
return error.response?.data;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const AuthApi = new AuthApiService();
|
||||
|
||||
Reference in New Issue
Block a user