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

Auth urls #7

Merged
merged 4 commits into from
Feb 20, 2020
Merged

Auth urls #7

merged 4 commits into from
Feb 20, 2020

Conversation

SimonLab
Copy link
Member

ref: #6
Allow user to login with Github or Google

image

@SimonLab SimonLab temporarily deployed to app-mvp-elm February 14, 2020 15:47 Inactive
@@ -27,19 +30,21 @@ main =

type Page
= Home
| Auth
| Auth (Maybe String)
Copy link
Member Author

Choose a reason for hiding this comment

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

the Maybe String represent the query parameter jwt on the auth endpoint.
This endpoint can be /auth then jwt is Nothing or /auth?jwt=... then the value is Just ...

Copy link
Member

@nelsonic nelsonic left a comment

Choose a reason for hiding this comment

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

@SimonLab I still have a strong preference for handling all auth on the server including displaying the buttons in SVG + CSS then redirecting back to the Elm App once the person has authenticated with the 3rd Party OAuth Provider. Server side auth reduces complexity and improves maintainability without sacrificing UX.

Having reiterated that, I think the code you have written here looks good and look forward to seeing your continued progress. 👍

@nelsonic nelsonic merged commit 7507bab into master Feb 20, 2020
@nelsonic nelsonic deleted the auth-urls-#6 branch February 20, 2020 09:39
@SimonLab
Copy link
Member Author

SimonLab commented Feb 20, 2020

Thanks for merging.

I still have a strong preference for handling all auth on the server

I'll write down an issue with the requirement on https://github.com/dwyl/auth-mvp/, I think I had misunderstood where the authentication (ie google and gihtub signin button) page was supposed to be rendered.

@nelsonic
Copy link
Member

If we render the Auth on the server it can be rendered on any platform.
So if we build a Native App in Electron, Flutter or Swift etc. it's just a WebView that redirects back to the Native App. And for MVP if the person does not have a valid JWT when they attempt to make a request, the page just automatically redirects to auth.dwyl.com where the buttons are displayed in SVG+CSS. 💭

What I'd say is keep going with what you are doing because it's a valid approach.
I just want to remind you that you might be overthinking it by doing the Auth interactions in Elm via API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants