mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 12:43:25 +00:00
remove ofetch, replace with fetch
This commit is contained in:
@@ -1,21 +1,20 @@
|
||||
import { ofetch } from "ofetch";
|
||||
|
||||
import type {
|
||||
ChallengeTokenResponse,
|
||||
LoginInput,
|
||||
LoginResponse,
|
||||
} from "./types";
|
||||
import { f } from "./fetch";
|
||||
|
||||
export async function getLoginChallengeToken(
|
||||
url: string,
|
||||
publicKey: string,
|
||||
): Promise<ChallengeTokenResponse> {
|
||||
return ofetch<ChallengeTokenResponse>("/auth/login/start", {
|
||||
return f<ChallengeTokenResponse>("/auth/login/start", {
|
||||
method: "POST",
|
||||
body: {
|
||||
publicKey,
|
||||
},
|
||||
baseURL: url,
|
||||
baseUrl: url,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -23,12 +22,12 @@ export async function loginAccount(
|
||||
url: string,
|
||||
data: LoginInput,
|
||||
): Promise<LoginResponse> {
|
||||
return ofetch<LoginResponse>("/auth/login/complete", {
|
||||
return f<LoginResponse>("/auth/login/complete", {
|
||||
method: "POST",
|
||||
body: {
|
||||
namespace: "movie-web",
|
||||
...data,
|
||||
},
|
||||
baseURL: url,
|
||||
baseUrl: url,
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user