-
Notifications
You must be signed in to change notification settings - Fork 994
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
Generators: Add auth generator for Magic.Link #623
Comments
Hi, I'd like to work on this if no else has started. I'm new here, I've just finished the tutoral and browsed the framework code. I'd also like to say, I really like the vision of this project. Cheers |
Great! I'll assign this one to you. Definitely look to @cannikin as point for help along the way with the generators. For any Auth specific instructions, @peterp created the original package and @burnsy did the provider work on Magic.Link. Oh, and I'm the annoying guy who will show up at the very end to ask if the PR includes updated documentation 😉 (Everyone has their role, right?) Looking forward to this one 🚀 |
Ok great!, Thanks for the detailed reply @thedavidprice |
I don't mind giving a hand if needed! 👍 |
@cannikin or @burnsy I'm having trouble generating the correct import statement for magic.link. It needs to create {} around the inport i.e. .. import { Magic } from 'magic-sdk'... right now it does not, it generates import Magic from 'magic-sdk. |
Did you try doing: imports: [{ import: '{ Magic }', from: 'magic-sdk' }] The code that writes out the import does: const importStatements = imports.map((imp) => {
return `import ${imp.import} from '${imp.from}'`
}) So it should include the {} as long as they're inside that first string. |
@cannikin no I didn't, because the auth0 provider, which generates brackets, isn't Implemented that way . I'm wondering how it was accomplished in that case. Anyway,I will try your suggestion thanks! |
That might be a bug—if auth0 requires { } around the import then that generator should definitely have them! When you refer to the back-end are you talking about the code in |
@cannikin Ok thanks, that makes sense. |
Opened a PR to fix that auth0 import! #640 |
There are a few things in motion with docs as we are in a bit of a re-org. So most of the docs are or will be in this /docs folder on the .com repo. But you are correct --> currently the Auth doc is the README in the auth package. For the generator, it looks like you'll primarily need to update the "Installation" section both for available providers and the Manual Install of Magic.Link (assuming a package would need to be added). AND you'll also need to add the provider option to this section of the CLI Docs. This Doc correlates with the information you should see when you run Lots of bits and pieces, but is it making sense? Thanks again! |
@thedavidprice the second link you left is broken. Can you give a path, I can't seem to find it |
Sorry about that. Re-adding them all here:
|
@thedavidprice I'm unclear as how to edit the docs in the redwood.js repo within this pull request. |
Ah, great question! And you may feel new, but trust me, we're all relatively new and figuring things out as we go. Together. So welcome to the party 🎉 Yes, you'll need to handle that separately on the redwoodjs.com repo. That doc was created by @jtoar who I'm sure would be happy to help if/when needed. Overall we're just trying to get better at including doc creation/update with PRs. But sometimes that might simply mean creating an Issue with a plan and making a handoff by asking for help. Whatever steps you're able to take, just reference the other Issues or PRs via links to the main Issue or PR -- that way we can allow follow the trail, connect dots, and quickly see what next steps might need to be completed. |
@thedavidprice Ok, Thanks again. I'll do that. |
Now that support for Magic.Link has been added to @redwoodjs/auth as of 0.8.0 we can add a generator that helps setup and configure this automatically.
Take a look at the existing providers and the README to see how to add Magic.Link support. If you need additional hooks to insert generated code into you will need to modify the auth generator itself.
The text was updated successfully, but these errors were encountered: