Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: rename functions and refactor native library calls into separate functions #126

Conversation

deepjyoti30-st
Copy link

@deepjyoti30-st deepjyoti30-st commented Dec 17, 2024

Summary of change

This PR does the following:

  • renames the function names for webauthn for them to be more descriptive to the user.
  • refactors the native library calls to make them override-able

Related issues

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)

Documentation changes

(If relevant, please create a PR in our docs repo, or create a checklist here highlighting the necessary changes)

Checklist for important updates

  • Changelog has been updated
  • frontendDriverInterfaceSupported.json file has been updated (if needed)
    • Along with the associated array in lib/ts/version.ts
  • webJsInterfaceSupported.json file has been updated (if needed)
  • Changes to the version if needed
    • In package.json
    • In package-lock.json
    • In lib/ts/version.ts
  • Had run npm run build-pretty
  • Had installed and ran the pre-commit hook
  • Issue this PR against the latest non released version branch.
    • To know which one it is, run find the latest released tag (git tag) in the format vX.Y.Z, and then find the latest branch (git branch --all) whose X.Y is greater than the latest released tag.
    • If no such branch exists, then create one from the latest released branch.

Copy link

github-actions bot commented Dec 17, 2024

size-limit report 📦

Path Size
lib/build/index.js 27.23 KB (0%)
recipe/emailverification/index.js 27.65 KB (0%)
recipe/emailpassword/index.js 27.6 KB (0%)
recipe/thirdparty/index.js 28.39 KB (0%)
recipe/session/index.js 24.37 KB (0%)
recipe/passwordless/index.js 28.66 KB (0%)
recipe/userroles/index.js 24.64 KB (0%)
recipe/multitenancy/index.js 26.95 KB (0%)
recipe/multifactorauth/index.js 27.05 KB (0%)
recipe/totp/index.js 26.87 KB (0%)
recipe/oauth2provider/index.js 27.4 KB (0%)

@deepjyoti30-st deepjyoti30-st changed the title feat: rename functions to be more descriptive feat: rename functions and refactor native library calls into separate functions Dec 17, 2024
@@ -311,7 +357,7 @@ export default class RecipeWrapper {
*
* @returns `{ status: "OK", ...}` if successful along a description of the user details (id, etc.) and email
*/
static registerAndSignUp(input: { email: string; options?: RecipeFunctionOptions; userContext: any }): Promise<
static registerUserWithSignUp(input: { email: string; options?: RecipeFunctionOptions; userContext: any }): Promise<

Choose a reason for hiding this comment

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

I think this name sounds a bit confusing. What would be the difference between register and signUp ?

Copy link
Author

Choose a reason for hiding this comment

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

Agree with the changes, I have made them.

@@ -358,7 +405,11 @@ export default class RecipeWrapper {
*
* @returns `{ status: "OK", ...}` if successful along a description of the user details (id, etc.) and email
*/
static authenticateAndSignIn(input: { email: string; options?: RecipeFunctionOptions; userContext: any }): Promise<
static authenticateUserWithSignIn(input: {

Choose a reason for hiding this comment

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

Same here. Sounds a bit confusing

@@ -354,9 +354,29 @@ export default function getRecipeImplementation(
fetchResponse,
};
},
registerAndSignUp: async function ({ email, options, userContext }) {
registerUser: async function ({ registrationOptions }) {

Choose a reason for hiding this comment

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

i think this should contain some credential reference in the name, as the main purpose of this method is to generate the credential for a user (in order for the credential to be registered - either on sign up or, in the future, on registerCredential in their "profile" )

}

throw error;
const registerUserResponse = await this.registerUser({ registrationOptions });

Choose a reason for hiding this comment

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

same here. The name should indicate that this is about the credential and not the user.

@deepjyoti30-st deepjyoti30-st merged commit 97aa10f into feat/webauthn-native-wrappers Dec 19, 2024
1 of 5 checks passed
@deepjyoti30-st deepjyoti30-st deleted the feat/rename-functions-to-be-more-descriptive branch December 19, 2024 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants