Skip to content

Commit 791d39b

Browse files
committed
Update auth-handler.ts
1 parent 00edc15 commit 791d39b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/thirdweb/src/login/client/login.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { Chain } from "../../chains/types.js";
22
import type { ThirdwebClient } from "../../client/client.js";
33
import type { PreparedTransaction } from "../../transaction/prepare-transaction.js";
4+
import { getAddress } from "../../utils/address.js";
45
import type { AsyncStorage } from "../../utils/storage/AsyncStorage.js";
56
import { inAppWallet } from "../../wallets/in-app/web/in-app.js";
67
import type { Account, Wallet } from "../../wallets/interfaces/wallet.js";
@@ -205,7 +206,10 @@ function mapAccount(
205206
: undefined,
206207
});
207208
// if the JWT is valid, we can simply return it
208-
if (data?.address === account.address) {
209+
if (
210+
data?.address &&
211+
getAddress(data.address) === getAddress(account.address)
212+
) {
209213
// set the JWT in the local state
210214
jwt_cache = {
211215
jwt: data.jwt,

packages/thirdweb/src/login/server/auth-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export function createAuthHandler({
7070
basePath = "/api/auth",
7171
...options
7272
}: CreateAuthHandlerOptions) {
73-
// re-map the server wallet to to the admin account option
73+
// re-map the server wallet to the admin account option
7474
const twAuth = createAuth({ ...options, adminAccount: serverWallet });
7575

7676
// payload generation endpoint

0 commit comments

Comments
 (0)