add refresh token in axios
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
type LoginWithPasswordType,
|
||||
type OtpVerifyType,
|
||||
type RefreshTokenType,
|
||||
type RefreshTokenResponse,
|
||||
type RegisterType,
|
||||
} from "../types/AuthTypes";
|
||||
|
||||
@@ -39,7 +40,12 @@ export const register = async (params: RegisterType) => {
|
||||
return data;
|
||||
};
|
||||
|
||||
export const refreshToken = async (params: RefreshTokenType) => {
|
||||
const { data } = await axios.post(`/auth/refresh`, params);
|
||||
export const refreshToken = async (
|
||||
params: RefreshTokenType
|
||||
): Promise<RefreshTokenResponse> => {
|
||||
const { data } = await axios.post<RefreshTokenResponse>(
|
||||
`/auth/refresh`,
|
||||
params
|
||||
);
|
||||
return data;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user