blitz-js / legacy-framework

MIT License
3 stars 2 forks source link

Auth Example Cleanup and Additions #194

Closed Swapnull closed 3 years ago

Swapnull commented 3 years ago

What do you want and why?

Firstly I would like to see it cleaned up. Currently looking at https://github.com/blitz-js/blitz/blob/canary/examples/auth/app/api/auth/%5B...auth%5D.ts there are inconsistencies and it is hard to say if they are on purpose or not.

Examples are line 80, 81 + 119 - Referencing twitter inside Auth0 and Github strategies. line 136 - Using "githubUsername" variable inside Auth0 strategy.

Secondly, I would love to see a LocalStrategy example included in there. It is one of the most common - but different than the rest examples.

Possible implementation(s)

Somebody who is comfortable with passport can take the file and clean it up.

Additional context

Once I have passport auth working in my app, I may come back and fix this, but right now I am using passport for the first time.

flybayer commented 3 years ago

Hey thanks!

I would love to see a LocalStrategy example

Not sure if it was you or not that I talked about this with in Discord. Why do you want to use passport local strategy instead of the blitz built in email/password solution?

Swapnull commented 3 years ago

Hey!

It was me who asked in Discord. I think you are correct that we can use the provided auth (which I have now done for my project), but maybe it is worth investigating why LocalStrategy didn't work as it could point to a problem with other passport integrations?

I think we could change this to be more about cleaning up the example?