Developer Questions

Ask a Question
Back to All

Issues getting user_token .....

I am using the server side SDK and i am successfully creating a sign in request and logging in via the always link returned ie

https://xumm.app/sign/22fbdc2a-2e36-43ab-b609-2f65edaed49c

My sign in function looks like the following ...

export const xummSignIn = async () => {
const payload = {
TransactionType: 'SignIn',
options: {
user_token: true,
},
} as any

try {
const subscription = await xummClient.payload.createAndSubscribe(
payload,
(event) => {
console.log('New payload event:', event)
if (Object.keys(event.data).indexOf('signed') > -1) {
return event.data
}
}
)

console.log('SUBSCRIPTION ', subscription.created)

return {
  qr_png: subscription.created.refs.qr_png,
  uuid: subscription.created.uuid,
  always: subscription.created.next.always,
}

} catch (error) {
console.error('Error fetching XUMM payment URL:', error)
throw new Error('Failed to fetch XUMM payment URL')
}
}

The response object comes back in the subscribe function but the issued_user_token is always null

ie issued_user_token: null

Any ideas ?