Skip to content

Commit 1557db3

Browse files
committed
refactor: remove extra anon fn
1 parent 556e113 commit 1557db3

File tree

1 file changed

+16
-19
lines changed
  • packages/thirdweb/src/wallets/in-app/core/authentication

1 file changed

+16
-19
lines changed

packages/thirdweb/src/wallets/in-app/core/authentication/guest.ts

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,22 @@ export async function guestAuthenticate(args: {
2929
}
3030

3131
const clientFetch = getClientFetch(args.client, args.ecosystem);
32-
const authResult = await (async () => {
33-
const path = getLoginCallbackUrl({
34-
authOption: "guest",
35-
client: args.client,
36-
ecosystem: args.ecosystem,
37-
});
38-
const res = await clientFetch(`${path}`, {
39-
method: "POST",
40-
headers: {
41-
"Content-Type": "application/json",
42-
},
43-
body: JSON.stringify({
44-
sessionId,
45-
}),
46-
});
32+
const path = getLoginCallbackUrl({
33+
authOption: "guest",
34+
client: args.client,
35+
ecosystem: args.ecosystem,
36+
});
37+
const res = await clientFetch(`${path}`, {
38+
method: "POST",
39+
headers: {
40+
"Content-Type": "application/json",
41+
},
42+
body: JSON.stringify({
43+
sessionId,
44+
}),
45+
});
4746

48-
if (!res.ok) throw new Error("Failed to generate guest account");
47+
if (!res.ok) throw new Error("Failed to generate guest account");
4948

50-
return (await res.json()) satisfies AuthStoredTokenWithCookieReturnType;
51-
})();
52-
return authResult;
49+
return (await res.json()) satisfies AuthStoredTokenWithCookieReturnType;
5350
}

0 commit comments

Comments
 (0)