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(authentication): support Email Link Authentication #172

Merged
merged 25 commits into from
Aug 12, 2022

Conversation

trancee
Copy link
Contributor

@trancee trancee commented Aug 6, 2022

Pull request checklist

Please check if your PR fulfills the following requirements:

  • The changes have been tested successfully.
  • A changeset has been created (npm run changeset).

Implements #36

@trancee trancee changed the title Feat/issue 36 feat(authentication): Email Link Authentication Aug 6, 2022
@robingenz
Copy link
Member

@trancee Thanks for your contribution! That's a lot of changes. I will not get to the review for a few days as i am currently updating all plugins to Capacitor 4. Until then, please revert all changes that are not absolutely necessary (e.g. package-lock.json, project.pbxproj).
Please also test your changes and tick this off in the PR description if done.

@trancee
Copy link
Contributor Author

trancee commented Aug 7, 2022

@trancee Thanks for your contribution! That's a lot of changes. I will not get to the review for a few days as i am currently updating all plugins to Capacitor 4. Until then, please revert all changes that are not absolutely necessary (e.g. package-lock.json, project.pbxproj). Please also test your changes and tick this off in the PR description if done.

Thanks for the feedback. I will try to revert the unnecessary changes.

By the way, there is also a linking/re-authentication part using the EmailAuthProvider. Is that something that should be implemented as well?
https://firebase.google.com/docs/auth/web/email-link-auth#linkingre-authentication_with_email_link

And I added these changes for version 0.6.0 if that is alright with you (in the docs).

@robingenz
Copy link
Member

Thank you! I will review it soon.

By the way, there is also a linking/re-authentication part using the EmailAuthProvider. Is that something that should be implemented as well?

No, this will be another PR in the future as this involves not only email sign in.

And I added these changes for version 0.6.0 if that is alright with you (in the docs).

This should be version 1.1.0 as the next release (Capacitor 4) will be 1.0.0.

@trancee
Copy link
Contributor Author

trancee commented Aug 7, 2022

No, this will be another PR in the future as this involves not only email sign in.

OK, that makes sense.

This should be version 1.1.0 as the next release (Capacitor 4) will be 1.0.0.

Should I change that already, or will you do this once you review the code?

@robingenz
Copy link
Member

I will add a comment in my review.

Copy link
Member

@robingenz robingenz left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution! I will review again after your changes.

packages/authentication/src/definitions.ts Outdated Show resolved Hide resolved
packages/authentication/src/definitions.ts Outdated Show resolved Hide resolved
packages/authentication/src/definitions.ts Outdated Show resolved Hide resolved
packages/authentication/src/definitions.ts Outdated Show resolved Hide resolved
packages/authentication/src/definitions.ts Outdated Show resolved Hide resolved
packages/authentication/docs/setup-email-link.md Outdated Show resolved Hide resolved
packages/authentication/docs/setup-email-link.md Outdated Show resolved Hide resolved
packages/authentication/docs/setup-email-link.md Outdated Show resolved Hide resolved
packages/authentication/docs/firebase-js-sdk.md Outdated Show resolved Hide resolved
packages/authentication/docs/firebase-js-sdk.md Outdated Show resolved Hide resolved
@trancee trancee requested a review from robingenz August 9, 2022 17:24
@trancee trancee requested a review from robingenz August 10, 2022 20:17
@trancee
Copy link
Contributor Author

trancee commented Aug 10, 2022

@robingenz I have added an additional step on how to enable app link functionality to directly open the link in the app. I hope it is clear enough.

@robingenz
Copy link
Member

@trancee Looks very good! Next time should be the last review.
I run the CI, you may need to fix lint errors.

@trancee
Copy link
Contributor Author

trancee commented Aug 11, 2022

@trancee Looks very good! Next time should be the last review. I run the CI, you may need to fix lint errors.

The errors from the CI are like these:

Error: tor-firebase/authentication:lint: [error] No parser could be inferred for file: android/src/androidTest/java/com/getcapacitor/android/ExampleInstrumentedTest.java
Error: tor-firebase/authentication:lint: [error] No parser could be inferred for file: android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/authentication/FirebaseAuthentication.java
Error: tor-firebase/authentication:lint: [error] No parser could be inferred for file: android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/authentication/FirebaseAuthenticationConfig.java
Error: tor-firebase/authentication:lint: [error] No parser could be inferred for file: android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/authentication/FirebaseAuthenticationHelper.java
Error: tor-firebase/authentication:lint: [error] No parser could be inferred for file: android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/authentication/FirebaseAuthenticationPlugin.java
Error: tor-firebase/authentication:lint: [error] No parser could be inferred for file: android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/authentication/GetIdTokenResultCallback.java
Error: tor-firebase/authentication:lint: [error] No parser could be inferred for file: android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/authentication/handlers/AppleAuthProviderHandler.java
Error: tor-firebase/authentication:lint: [error] No parser could be inferred for file: android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/authentication/handlers/FacebookAuthProviderHandler.java
Error: tor-firebase/authentication:lint: [error] No parser could be inferred for file: android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/authentication/handlers/GoogleAuthProviderHandler.java
Error: tor-firebase/authentication:lint: [error] No parser could be inferred for file: android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/authentication/handlers/OAuthProviderHandler.java
Error: tor-firebase/authentication:lint: [error] No parser could be inferred for file: android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/authentication/handlers/PhoneAuthProviderHandler.java
Error: tor-firebase/authentication:lint: [error] No parser could be inferred for file: android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/authentication/handlers/PlayGamesAuthProviderHandler.java
Error: tor-firebase/authentication:lint: [error] No parser could be inferred for file: android/src/test/java/com/getcapacitor/ExampleUnitTest.java

But honestly, I have no idea what to do with that. Is there a configuration issue?

@trancee trancee requested a review from robingenz August 11, 2022 05:00
@robingenz
Copy link
Member

But honestly, I have no idea what to do with that. Is there a configuration issue?

Are you using npm or pnpm etc.? (found this):

Copy link
Member

@robingenz robingenz left a comment

Choose a reason for hiding this comment

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

LGTM! Only the CI (linting, etc.) is left.

@trancee
Copy link
Contributor Author

trancee commented Aug 11, 2022

But honestly, I have no idea what to do with that. Is there a configuration issue?

Are you using npm or pnpm etc.? (found this):

I am using only npm. But the CI is not using any of my local packages anyway, isn't it? I am looking at the issue you referenced to figure out what's going on.

@trancee trancee requested a review from robingenz August 11, 2022 18:10
@robingenz
Copy link
Member

You're right. 😄 In the CI the error should not occur.

@robingenz robingenz added this to the v1.1.0 milestone Aug 11, 2022
@robingenz
Copy link
Member

The last lint errors:

@capacitor-firebase/authentication:lint: /Users/runner/work/capacitor-firebase/capacitor-firebase/packages/authentication/ios/Plugin/FirebaseAuthenticationPlugin.swift:151:62: error: Force Cast Violation: Force casts should be avoided. (force_cast)
@capacitor-firebase/authentication:lint: /Users/runner/work/capacitor-firebase/capacitor-firebase/packages/authentication/ios/Plugin/FirebaseAuthenticationPlugin.swift:158:63: error: Force Cast Violation: Force casts should be avoided. (force_cast)
@capacitor-firebase/authentication:lint: /Users/runner/work/capacitor-firebase/capacitor-firebase/packages/authentication/ios/Plugin/FirebaseAuthenticationPlugin.swift:163:40: error: Force Cast Violation: Force casts should be avoided. (force_cast)
@capacitor-firebase/authentication:lint: /Users/runner/work/capacitor-firebase/capacitor-firebase/packages/authentication/ios/Plugin/FirebaseAuthentication.swift:183:1: error: Line Length Violation: Line should be 200 characters or less: currently 228 characters (line_length)
@capacitor-firebase/authentication:lint: /Users/runner/work/capacitor-firebase/capacitor-firebase/packages/authentication/ios/Plugin/FirebaseAuthentication.swift:271:1: error: Line Length Violation: Line should be 200 characters or less: currently 242 characters (line_length)

@trancee trancee requested a review from robingenz August 12, 2022 05:04
@robingenz robingenz changed the title feat(authentication): Email Link Authentication feat(authentication): support Email Link Authentication Aug 12, 2022
@robingenz robingenz merged commit ad7c25b into capawesome-team:main Aug 12, 2022
@github-actions github-actions bot mentioned this pull request Aug 12, 2022
@robingenz
Copy link
Member

@trancee Thank you so much for your contribution. Great work!
This is the dev release you can already use:

npm i @capacitor-firebase/authentication@1.0.0-dev.077e999.1660304202

v1.1.0 will be published next week (see milestone).

@robingenz
Copy link
Member

@trancee Btw: I think the twitter account in your GitHub profile is wrong or? One e too much? 😁 I would like to mention you on the release.

@trancee
Copy link
Contributor Author

trancee commented Aug 12, 2022

@trancee Btw: I think the twitter account in your GitHub profile is wrong or? One e too much? grin I would like to mention you on the release.

Oh, wow, I haven't noticed that for such a long time! Thanks for pointing that out to me, I have fixed it :)

Paso pushed a commit to ice-cream-club/capacitor-firebase that referenced this pull request Apr 19, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 13, 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.

2 participants