File tree Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import type { FastifyPluginAsync } from "fastify";
7
7
8
8
import "../middleware/chain" ;
9
9
import "../middleware/swagger" ;
10
- import { getUser } from "thirdweb" ;
10
+ import { type GetUserResult , getUser } from "thirdweb" ;
11
11
import type {
12
12
LoginBody ,
13
13
LoginReply ,
@@ -119,14 +119,20 @@ export const authRoutes =
119
119
120
120
if ( adminAddress ) {
121
121
// Look up any associated user details in the embedded wallet
122
- const thirdwebUser = await getUser ( {
123
- client,
124
- ecosystem : {
125
- id : env . THIRDWEB_ECOSYSTEM_ID ,
126
- partnerId : env . THIRDWEB_ECOSYSTEM_PARTNER_ID ,
127
- } ,
128
- walletAddress : adminAddress ,
129
- } ) ;
122
+ let thirdwebUser : GetUserResult | null | undefined ;
123
+ try {
124
+ thirdwebUser = await getUser ( {
125
+ client,
126
+ ecosystem : {
127
+ id : env . THIRDWEB_ECOSYSTEM_ID ,
128
+ partnerId : env . THIRDWEB_ECOSYSTEM_PARTNER_ID ,
129
+ } ,
130
+ walletAddress : adminAddress ,
131
+ } ) ;
132
+ } catch {
133
+ // Ignore failures from the Thirdweb SDK, this info is "nice-to-have"
134
+ }
135
+
130
136
if ( thirdwebUser ) {
131
137
const email = parseThirdwebUserEmail ( thirdwebUser ) ;
132
138
if ( email ) {
You can’t perform that action at this time.
0 commit comments