Skip to content

docs: Document serverpod_auth_email setup and migrating from serverpod_auth to the new provider using serverpod_auth_migration #302

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tp
Copy link
Collaborator

@tp tp commented Jun 23, 2025

Closes serverpod/serverpod#3663

Summary by CodeRabbit

  • Documentation
    • Added a comprehensive guide for setting up authentication in Serverpod using built-in modules, covering email and social sign-in, session management, and security configurations.
    • Introduced detailed instructions for upgrading from the legacy authentication package to the new modular authentication system, including migration strategies and example code for transitioning user data.

…rpod_auth` to the new provider using `serverpod_auth_migration`

Closes serverpod/serverpod#3663
@tp tp force-pushed the auth-migration branch from f7cb083 to e483819 Compare June 27, 2025 12:28
Copy link

coderabbitai bot commented Jun 27, 2025

📝 Walkthrough

Walkthrough

Two new documentation files are added: one provides a detailed guide for setting up authentication in Serverpod using modular packages, and the other outlines the migration process from the legacy serverpod_auth package to the new modular system, including migration steps, code examples, and configuration notes.

Changes

File(s) Change Summary
docs/06-concepts/11-authentication/01-setup_new.md Added a new documentation file detailing setup of modular authentication in Serverpod.
docs/08-upgrading/06-upgrading-from-serverpod_auth.md Added a new documentation file describing migration from legacy serverpod_auth to modular auth.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant Docs
    Developer->>Docs: Read setup_new.md
    Docs-->>Developer: Instructions for setting up modular authentication

    Developer->>Docs: Read upgrading-from-serverpod_auth.md
    Docs-->>Developer: Guidance for migrating legacy auth data and endpoints
Loading

Assessment against linked issues

Objective Addressed Explanation
Add guide for migrating from serverpod_auth to serverpod_auth_email[_account] (#3663)

Possibly related issues


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@tp
Copy link
Collaborator Author

tp commented Jun 27, 2025

@coderabbitai full review

Copy link

coderabbitai bot commented Jun 27, 2025

✅ Actions performed

Full review triggered.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (11)
docs/06-concepts/11-authentication/01-setup_new.md (7)

3-3: Fix verb agreement (“modules make”).

Plural subject → plural verb.

- The modules makes it easy to authenticate
+ The modules make it easy to authenticate

9-9: Hyphenate “ready-to-use”.

Correct compound adjective spelling improves readability.

-We provide the following packages of ready-to use authentication providers.
+We provide the following ready-to-use authentication provider packages.

15-15: Typo: “Sing” → “Sign”.

-|`serverpod_auth_google`|Ready to use "Sing in with Google authentication.|
+|`serverpod_auth_google`|Ready to use "Sign in with Google" authentication.|

17-17: Plural noun & missing comma.

-If you would like the basic authentication offered by these package, but combine them with a different approach to session management or another kind of user profile have
+If you would like the basic authentication offered by these packages, but want to combine them with a different approach to session management or another kind of user profile, have

27-29: Hyphenate “email-based” & add comma after “By default”.

-To get started with email based authentications,
+To get started with email-based authentication,
...
-By default this adds user profiles
+By default, this adds user profiles

58-59: Awkward sentence – clarify override usage.

The current phrasing is hard to parse.

-In this `class` `@override`s could be used to augment the default endpoint implementation.
+You can override individual methods in this class to augment the default endpoint implementation.

121-122: Typo: “roatation” → “rotation”.

-... and thus a roatation would invalidate previously created credentials.
+... and thus a rotation would invalidate previously created credentials.
docs/08-upgrading/06-upgrading-from-serverpod_auth.md (4)

3-3: Past participle missing (“was replaced”).

-... package was replace with a set of modular packages ...
+... package was replaced with a set of modular packages ...

24-24: Add apostrophe (“one’s”).

-... update ones own data ...
+... update one’s own data ...

46-48: Insert comma after introductory phrase & remove “In order to”.

-During a login we can verify the incoming credentials,
+During a login, we can verify the incoming credentials,
...
-In order to avoid creating duplicate accounts
+To avoid creating duplicate accounts

100-100: Spell out abbreviation (“e.g.”).

-... request (eg. registering a new account ...
+... request (e.g., registering a new account ...
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7d9c9a7 and e483819.

📒 Files selected for processing (2)
  • docs/06-concepts/11-authentication/01-setup_new.md (1 hunks)
  • docs/08-upgrading/06-upgrading-from-serverpod_auth.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/08-upgrading/06-upgrading-from-serverpod_auth.md

[grammar] ~3-~3: Consider using either the past participle “replaced” or the present participle “replacing” here.
Context: ...gle legacy serverpod_auth package was replace with a set of modular packages providin...

(BEEN_PART_AGREEMENT)


[uncategorized] ~24-~24: It seems likely that a singular genitive (’s) apostrophe is missing.
Context: ...p 6, one needs to ensure to also update ones own data to point to the new AuthUser...

(AI_HYDRA_LEO_APOSTROPHE_S_XS)


[typographical] ~46-~46: Consider adding a comma after this introductory phrase.
Context: ...and the email authentication. During a login we can verify the incoming credentials,...

(AS_A_NN_COMMA)


[style] ~48-~48: Consider a more concise word here.
Context: ...ll have to resort to a password reset. In order to avoid creating duplicate accounts for t...

(IN_ORDER_TO_PREMIUM)


[uncategorized] ~100-~100: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...en proceeding with the desired request (eg. registering a new account if none exist...

(E_G)

docs/06-concepts/11-authentication/01-setup_new.md

[grammar] ~3-~3: You should probably use “make”.
Context: ...serverpod_auth_* modules. The modules makes it easy to authenticate with email or s...

(AGREEMENT_SENT_START)


[uncategorized] ~17-~17: The grammatical number of this noun doesn’t look right. Consider replacing it.
Context: ...e basic authentication offered by these package, but combine them with a different appr...

(AI_EN_LECTOR_REPLACEMENT_NOUN_NUMBER)


[uncategorized] ~17-~17: A comma might be missing here.
Context: ...sion management or another kind of user profile have [a look at the underlying packages...

(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)


[uncategorized] ~27-~27: This expression is usually spelled with a hyphen.
Context: ...nstance. ## Email To get started with email based authentications, add `serverpod_auth_em...

(BASED_HYPHEN)


[uncategorized] ~27-~27: Did you mean: “By default,”?
Context: ...ent (through serverpod_auth_session). By default this adds user profiles for each regist...

(BY_DEFAULT_COMMA)


[uncategorized] ~39-~39: Possible missing comma found.
Context: ...ub add serverpod_auth_email_server ``` Further it's advisable to depend on `serverpod_...

(AI_HYDRA_LEO_MISSING_COMMA)


[style] ~46-~46: Consider a more concise word here.
Context: ... has to be added to the current project in order to expose its APIs to outside client. For...

(IN_ORDER_TO_PREMIUM)


[typographical] ~47-~47: Use a comma after an introductory phrase.
Context: ... to expose its APIs to outside client. For this add an email_account_endpoint.dart fi...

(COMMA_INTRODUCTORY_WORDS_PHRASES)


[style] ~76-~76: Consider a more concise word here.
Context: ...er, // Add this line ); ... } ``` In order to generate server and client the code for...

(IN_ORDER_TO_PREMIUM)


[uncategorized] ~82-~82: A comma may be missing after the conjunctive/linking adverb ‘Additionally’.
Context: ...run: bash $ serverpod generate Additionally the database schema will need to be ext...

(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)


[typographical] ~89-~89: Use a comma after an introductory phrase.
Context: ...ation package needs to be configured. For this set the EmailAccounts.config from pac...

(COMMA_INTRODUCTORY_WORDS_PHRASES)


[typographical] ~90-~90: It appears that a comma is missing.
Context: ...kage needs to be configured. For this set the EmailAccounts.config from package...

(DURING_THAT_TIME_COMMA)


[style] ~90-~90: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...he await pod.start(); call. Callbacks need to be provided for at least `sendRegistrat...

(REP_NEED_TO_VB)


[uncategorized] ~120-~120: A comma may be missing after the conjunctive/linking adverb ‘Additionally’.
Context: ...ight want to send the "request ID" --> Additionally you need to update the passwords.yaml...

(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)


[style] ~121-~121: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ... the "request ID" --> Additionally you need to update the passwords.yaml file to inc...

(REP_NEED_TO_VB)


[typographical] ~124-~124: Consider inserting a comma for improved readability.
Context: ...tials. After a restart of the Serverpod the new endpoints will be usable from the c...

(INITIAL_ADVP_COMMA)


[uncategorized] ~202-~202: This verb does not appear to agree with the subject. Consider using a different form.
Context: ...# Authentication The following package provide the core authentication functionality, ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~202-~202: A comma may be missing after the conjunctive/linking adverb ‘Thus’.
Context: ...default Endpoint base implementation. Thus they can be combined with another sessi...

(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)


[uncategorized] ~202-~202: A comma might be missing here.
Context: ... include further modification, like for example a custom user profile. |Package|Functi...

(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)

🔇 Additional comments (1)
docs/06-concepts/11-authentication/01-setup_new.md (1)

150-164: Potential ordering issue in client initialization.

sessionManager uses client.modules but client is assigned afterwards; this would be null at construction time. Swap initialization order or pass a temporary client.

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.

Add guide for migrating from serverpod_auth to serverpod_auth_email[_account]
1 participant