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

Adds Fullstack Nextjs Auth Tutorial #18092

Open
wants to merge 10 commits into
base: production
Choose a base branch
from

Conversation

mackenly
Copy link
Contributor

Summary

Developer Spotlight Tutorial
Contact with Daniel Benhamou

Documentation checklist

  • The documentation style guide has been adhered to.
  • If a larger change - such as adding a new page- an issue has been opened in relation to any incorrect or out of date information that this PR fixes.

@mackenly
Copy link
Contributor Author

Please let me know if any changes need to be made. Thanks!

Copy link
Contributor

@hyperlint-ai hyperlint-ai bot left a comment

Choose a reason for hiding this comment

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

2 files reviewed, 3 total issue(s) found.


Note: We resolved prior Hyperlint review comments because:

We updated our inline suggestion AI.

We do this to avoid keeping outdated or irrelevant comments around. We'll leave a new review with current comments below.

@db-cloudflare db-cloudflare added DevRel Tasks that need support from developer relations. developer-spotlight labels Nov 11, 2024
@harshil1712 harshil1712 self-assigned this Nov 14, 2024
Copy link
Contributor

@harshil1712 harshil1712 left a comment

Choose a reason for hiding this comment

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

Hey @mackenly, thank you for this great tutorial! I have reviewed it and left a few comments. At it's current state, I was not able to run it successfully. The reason being the table not getting created at all. In the comments, you will find more details.


Auth.js provides integrations for many different credential providers such as Google, GitHub, etc. For this tutorial we're going to use Resend magic links.

Before continuing, either choose an alternative credential provider or ensure you have a domain and API key from Resend.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we move this to pre-requisites? For development purposes, is configuring the domain required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@harshil1712 Moved. Unfortunately, they don't provide a default sending domain.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If preferred, I could change to using Passkeys or username/pass, which wouldn't require a 3rd party service: https://authjs.dev/getting-started/authentication/webauthn

Copy link
Contributor

Choose a reason for hiding this comment

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

Moving off from Resend might be more work. Let's stick to it. I would hate for you to do more work. I have used Resend, in the development I always use [email protected] as the from email. For the to email, I use the email I used to Sign-Up with Resend. This way I don't need to setup a domain. Maybe, you can try this? We can add a note mentioning that to use in production, one needs to configure the domain.


You'll need to run this once on your production database to create the necessary tables. If you're following along with this tutorial, we'll run it together in a few steps.

:::note[Clean up]
Copy link
Contributor

Choose a reason for hiding this comment

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

Won't it be better to create the table using the wrangle d1 execute command instead? This way, the user doesn't have to remove the api and re-deploy the app again

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@harshil1712 I do agree that this would be more seamless, but there's also a trade off of keeping the tutorial updated with any changes. The adapter docs do recommend using the up() method or we could copy the SQL from here. I can't think of a good way to dynamically pull that. Open to whichever direction you think would align best with the doc styles.

Copy link
Contributor

Choose a reason for hiding this comment

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

In that case, let's use the up() method as you suggested.

@mackenly
Copy link
Contributor Author

mackenly commented Dec 2, 2024

@harshil1712 I'll take a look and address feedback items. Thanks!

@harshil1712
Copy link
Contributor

Hey @mackenly, please let me know if it is ready for review

@mackenly
Copy link
Contributor Author

@harshil1712 A few outstanding feedback follow-up questions. If you can, take a look at these, and let me know next steps:

@harshil1712
Copy link
Contributor

Hey @mackenly,
Hope your holidays were fun!
Apologies for the delay on my end. I have addressed all the remaining comments. Please let me know if I missed any.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer-spotlight DevRel Tasks that need support from developer relations. product:developer-spotlight size/m
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants