Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
fix: change login to auth key
Browse files Browse the repository at this point in the history
  • Loading branch information
xstelea committed May 12, 2023
1 parent 9b2bbda commit d281902
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/IO/v1/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export type WalletAuthorizedRequestItems = z.infer<
>
export const WalletAuthorizedRequestItems = object({
discriminator: literal('authorizedRequest'),
login: AuthRequestItem,
auth: AuthRequestItem,
reset: ResetRequestItem.optional(),
oneTimeAccounts: AccountsRequestItem.optional(),
ongoingAccounts: AccountsRequestItem.optional(),
Expand Down Expand Up @@ -263,7 +263,7 @@ export type WalletAuthorizedRequestResponseItems = z.infer<
>
export const WalletAuthorizedRequestResponseItems = object({
discriminator: literal('authorizedRequest'),
login: AuthRequestResponseItem,
auth: AuthRequestResponseItem,
oneTimeAccounts: AccountsRequestResponseItem.optional(),
oneTimePersonaData: PersonaDataRequestResponseItem.optional(),
ongoingAccounts: AccountsRequestResponseItem.optional(),
Expand Down
12 changes: 6 additions & 6 deletions lib/__tests__/wallet-sdk.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ describe('sdk flow', () => {
sdk.request(
{
discriminator: 'authorizedRequest',
login: {
auth: {
discriminator: 'loginWithoutChallenge',
},
ongoingAccounts: {
Expand All @@ -231,7 +231,7 @@ describe('sdk flow', () => {
delay(300).then(() => {
sendIncomingMessage({
discriminator: 'authorizedRequest',
login: {
auth: {
discriminator: 'loginWithoutChallenge',
persona: {
identityAddress:
Expand Down Expand Up @@ -278,7 +278,7 @@ describe('sdk flow', () => {
],
})

expect((result.value as any).login.persona.identityAddress).toEqual(
expect((result.value as any).auth.persona.identityAddress).toEqual(
'account_tdx_b_1qlu8fdyj77jpmu2mqe4rgh3738jcva4nfd2y2vp675zqgdg72y'
)

Expand All @@ -298,7 +298,7 @@ describe('sdk flow', () => {
sdk.request(
{
discriminator: 'authorizedRequest',
login: {
auth: {
discriminator: 'usePersona',
identityAddress:
'account_tdx_b_1qlu8fdyj77jpmu2mqe4rgh3738jcva4nfd2y2vp675zqgdg72y',
Expand All @@ -314,7 +314,7 @@ describe('sdk flow', () => {
delay(300).then(() => {
sendIncomingMessage({
discriminator: 'authorizedRequest',
login: {
auth: {
discriminator: 'loginWithoutChallenge',
persona: {
identityAddress:
Expand All @@ -328,7 +328,7 @@ describe('sdk flow', () => {
const result = await request

if (result.isErr()) throw new Error('should not get a error response')
expect((result.value as any).login.persona.identityAddress).toEqual(
expect((result.value as any).auth.persona.identityAddress).toEqual(
'account_tdx_b_1qlu8fdyj77jpmu2mqe4rgh3738jcva4nfd2y2vp675zqgdg72y'
)

Expand Down

0 comments on commit d281902

Please sign in to comment.