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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(rest-example): add google login example using accounts-js oauth #961

Closed
wants to merge 1 commit into from

Conversation

nsine
Copy link
Contributor

@nsine nsine commented May 4, 2020

This PR adds very rough example of how to use accounts-js OAuth to login/register with Google.
Opening it (as a draft, as don't have too much time atm to polish it) mostly because @agustif asked some help on this and may be can be useful for others.

Feel free to pick this up and implement complete example if someone has time/motivation. This can serve as a good base to start from 馃檪.
What has to be done from my PoV to add this as an official example:

  • make nice styling
  • Add other examples apart from google (e.g. OOTB twitter, instagram)
  • Add error handling
  • Add some readme to oauth package and reference
  • Add page where we can link oauth providers to existing accounts (afaik @agustif already tried to do sth like this)

To make this work:

  • fill examples/react-rest-typescript/.env.development with valid google client id and callback url
  • create .env file in examples/rest-express-typescript folder with variables from .env.example in same folder

Hope that helps!

@codecov
Copy link

codecov bot commented May 4, 2020

Codecov Report

Merging #961 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #961   +/-   ##
=======================================
  Coverage   95.18%   95.18%           
=======================================
  Files          80       80           
  Lines        1786     1786           
  Branches      383      383           
=======================================
  Hits         1700     1700           
  Misses         84       84           
  Partials        2        2           

Continue to review full report at Codecov.

Legend - Click here to learn more
螖 = absolute <relative> (impact), 酶 = not affected, ? = missing data
Powered by Codecov. Last update 6d83068...8d3c02b. Read the comment docs.

@agustif
Copy link
Contributor

agustif commented May 6, 2020

Hey @nsine I just wanted to let you know I got to run it with Facebook too, basically copying your approach/code with the correct endpoints and api calls, made it work like magic!

I've forked your repo to push it to github, but I don't wanna hijack your PR, maybe I can for now use it in my own personal proejct and once your PR is merged to master expand on it adding the code for facebook as a second example!

Thanks again both to @pradel, @davidyaha, and @nsine for helping me out with this! Anyone who needs help with accounts/oauth can ping me, I'm a newbie expert now!

@detrohutt
Copy link

@agustif If you have a link to your fork where you got facebook working that'd be fantastic. I decided to use this project precisely because the docs mentioned support for facebook.

@agustif
Copy link
Contributor

agustif commented Jul 22, 2020

@agustif If you have a link to your fork where you got facebook working that'd be fantastic. I decided to use this project precisely because the docs mentioned support for facebook.

Answered in the othher issue, will upload publicly later today or tomorrow for you to lookout!

@agustif
Copy link
Contributor

agustif commented Jul 23, 2020

I remembeer now why I didnt upload before to be mergged to accounts, it has my own branding, etc, but I guess it can work for you so I will try to add it as my own personal public repo, or invite you to my private one maybe.

Plan to add a RFC Oauth and see how to implement back the packages and examples to be merged back to accounts-master if possible.

@detrohutt
Copy link

I remembeer now why I didnt upload before to be mergged to accounts, it has my own branding, etc, but I guess it can work for you so I will try to add it as my own personal public repo, or invite you to my private one maybe.

Either of those is fine with me. Thank you. :)

Plan to add a RFC Oauth and see how to implement back the packages and examples to be merged back to accounts-master if possible.

Are you saying you plan on doing this or that I should plan on doing this?

@agustif
Copy link
Contributor

agustif commented Jul 24, 2020

I remembeer now why I didnt upload before to be mergged to accounts, it has my own branding, etc, but I guess it can work for you so I will try to add it as my own personal public repo, or invite you to my private one maybe.

Either of those is fine with me. Thank you. :)

Plan to add a RFC Oauth and see how to implement back the packages and examples to be merged back to accounts-master if possible.

Are you saying you plan on doing this or that I should plan on doing this?

Hahaha sorry yeah I meant I was planning on doing it, I would never -prompt- or -require- you to do so! ofc...

I will invite you to my repo later today! and hopefully open the RFC too.

@detrohutt
Copy link

detrohutt commented Jul 26, 2020 via email

@agustif
Copy link
Contributor

agustif commented Aug 1, 2020

Hey, if you sent that invitation already I'm not seeing it. My email is detrohutt@gmail.com if that helps.Thanks!

On Fri, Jul 24, 2020, 11:55 AM Agusti Fernandez @.***> wrote: I remembeer now why I didnt upload before to be mergged to accounts, it has my own branding, etc, but I guess it can work for you so I will try to add it as my own personal public repo, or invite you to my private one maybe. Either of those is fine with me. Thank you. :) Plan to add a RFC Oauth and see how to implement back the packages and examples to be merged back to accounts-master if possible. Are you saying you plan on doing this or that I should plan on doing this? Hahaha sorry yeah I meant I was planning on doing it, I would never -prompt- or -require- you to do so! ofc... I will invite you to my repo later today! and hopefully open the RFC too. 鈥 You are receiving this because you commented. Reply to this email directly, view it on GitHub <#961 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKKLYZ7B4U3YJE7EZF5ZZLR5GVGPANCNFSM4MZFGNEA .

Sent now, couldn't do it before sorry.

@brightchip
Copy link

Where are the Google auth examples?

@nsine nsine closed this May 11, 2022
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.

None yet

4 participants