Fix cloud auth [object%20Object] (#1226)

This commit is contained in:
AutumnVN 2023-06-03 12:57:31 -07:00 committed by GitHub
parent 7b2bf08b8f
commit c9c0ab5aca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -77,14 +77,14 @@ export async function authorizeCloud() {
permissions={0n} permissions={0n}
clientId={clientId} clientId={clientId}
cancelCompletesFlow={false} cancelCompletesFlow={false}
callback={async (callbackUrl: string) => { callback={async ({ location }: any) => {
if (!callbackUrl) { if (!location) {
Settings.cloud.authenticated = false; Settings.cloud.authenticated = false;
return; return;
} }
try { try {
const res = await fetch(callbackUrl, { const res = await fetch(location, {
headers: new Headers({ Accept: "application/json" }) headers: new Headers({ Accept: "application/json" })
}); });
const { secret } = await res.json(); const { secret } = await res.json();