Skip to content

Commit

Permalink
fix: improve request logging
Browse files Browse the repository at this point in the history
  • Loading branch information
ariesclark committed Aug 12, 2024
1 parent 1c50f8f commit 97d393f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/api/vrchat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ const baseUrl = "https://vrchat.com/api/1/";
const baseApi = wretch()
.url(baseUrl)
.addon(QueryStringAddon)
.middlewares([log, cookie]);
.middlewares([cookie]);

async function verify2FA() {
const { verified } = await baseApi
.middlewares([log])
.url("auth/twofactorauth/totp/verify")
.json({
code: TOTP.generate(vrchatTotpSecret).otp
Expand All @@ -33,6 +34,7 @@ async function verify2FA() {

async function login(): Promise<boolean> {
const user = await baseApi
.middlewares([log])
.url("auth/user")
.auth(`Basic ${btoa(`${vrchatEmail}:${vrchatPassword}`)}`)
.get()
Expand Down Expand Up @@ -80,7 +82,8 @@ const api = baseApi.middlewares([

return response;
};
}
},
log
]);

export interface InfopushOptions {
Expand Down

0 comments on commit 97d393f

Please sign in to comment.