Skip to content

Conversation

@chanioxaris
Copy link
Member

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Packages affected

  • @clerk/clerk-js
  • @clerk/clerk-react
  • @clerk/nextjs
  • @clerk/remix
  • @clerk/types
  • @clerk/themes
  • @clerk/clerk-expo
  • @clerk/backend-core
  • @clerk/clerk-sdk-node
  • @clerk/edge
  • build/tooling/chore

Description

  • npm test runs as expected.
  • npm run build runs as expected.
  • Introduce the new BackupCode resource and the relevant types
  • Introduce a new user.createBackupCode() method, that generates a set for backup codes for a user

https://www.notion.so/clerkdev/Introduce-new-FAPI-me-backup-codes-endpoints-31f0832bb7544d4d90ba27758cac2a54

Copy link
Member

@nikosdouvlis nikosdouvlis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good!

path: this.path() + '/backup_codes/',
method: 'POST',
})
)?.response as unknown as BackupCodeJSON;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not an issue with this specific PR, but the type casting/ checking for the verifyTOTP, disableTOTP and createBackupCode is definitely brittle and since it involves network requests, the actual runtime value might be different that what we expect at this point

I did a very quick pass and I think that instead of the manual type casts, I'd rather use an assertion function to at least throw/ try to recover at that point. What do you think?

This can definitely be done in a separate PR as its not related with the changes made by Haris :)

cc @SokratisVidros

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@chanioxaris chanioxaris merged commit deb181b into main Sep 23, 2022
@chanioxaris chanioxaris deleted the backup-code-user-operation branch September 23, 2022 09:55
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants