Added end to end encryption
This commit is contained in:
parent
9153ba841d
commit
575e9e2010
131 changed files with 2289 additions and 1670 deletions
|
|
@ -1,21 +1,29 @@
|
|||
import { callApi, HTTP } from "../tools";
|
||||
import { IResponseError } from "../types";
|
||||
import {
|
||||
IFetchRegisterRequest,
|
||||
IFetchRegisterResponse,
|
||||
IFetchLoginRequest,
|
||||
IFetchLoginResponse,
|
||||
IFetchRefreshResponseError,
|
||||
IFetchRefreshResponseSuccess,
|
||||
IFetchRefreshResponse,
|
||||
} from "./types";
|
||||
|
||||
const fetchRegisterApi = async (
|
||||
request: IFetchRegisterRequest,
|
||||
): Promise<IFetchRegisterResponse | IResponseError> => {
|
||||
return await callApi(HTTP.POST, `auth/register`, request, true);
|
||||
};
|
||||
|
||||
const fetchLoginApi = async (
|
||||
request: IFetchLoginRequest,
|
||||
): Promise<IFetchLoginResponse> => {
|
||||
): Promise<IFetchLoginResponse | IResponseError> => {
|
||||
return await callApi(HTTP.POST, `auth/login`, request, true);
|
||||
};
|
||||
|
||||
const fetchRefreshApi = async (): Promise<
|
||||
IFetchRefreshResponseError | IFetchRefreshResponseSuccess
|
||||
IFetchRefreshResponse | IResponseError
|
||||
> => {
|
||||
return await callApi(HTTP.GET, `auth/refresh`, undefined, true);
|
||||
};
|
||||
|
||||
export { fetchLoginApi, fetchRefreshApi };
|
||||
export { fetchRegisterApi, fetchLoginApi, fetchRefreshApi };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue