Skip to content

Conversation

@tp
Copy link
Contributor

@tp tp commented Jun 23, 2025

localhost_3000_next_upgrading_upgrading-from-serverpod_auth (2)

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.

@tp tp force-pushed the auth-migration branch from f7cb083 to e483819 Compare June 27, 2025 12:28
@coderabbitai
Copy link

coderabbitai bot commented Jun 27, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 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
Contributor Author

tp commented Jun 27, 2025

@coderabbitai full review

@coderabbitai
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.

@tp tp force-pushed the auth-migration branch 4 times, most recently from 8905287 to e2f365b Compare June 30, 2025 17:26
@coderabbitai
Copy link

coderabbitai bot commented Jun 30, 2025

✅ Actions performed

Full review triggered.

@tp
Copy link
Contributor Author

tp commented Jun 30, 2025

@coderabbitai full review

@coderabbitai
Copy link

coderabbitai bot commented Jun 30, 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 (19)
docs/06-concepts/11-authentication/01-setup_new.md (12)

7-14: Fix table text & punctuation (“ready-to-use”, missing quotes).
Spelling / punctuation glitches make the first impression of the doc look sloppy.

-|Package|Functionality|
-| -|-|
-|`serverpod_auth_email`|Ready to use email authentication.|
-|`serverpod_auth_apple`|Ready to use "Sign in with Apple" authentication.|
-|`serverpod_auth_google`|Ready to use "Sign in with Google authentication.|
+|Package|Functionality|
+|-|-|
+|`serverpod_auth_email`|Ready-to-use email authentication.|
+|`serverpod_auth_apple`|Ready-to-use “Sign in with Apple” authentication.|
+|`serverpod_auth_google`|Ready-to-use “Sign in with Google” authentication.|

15-16: Add commas around parenthetical clause.

-... user profile have [a look at the underlying packages below](#low-level-building-blocks).
+... user profile, have [a look at the underlying packages below](#low-level-building-blocks).

25-25: Use hyphenated compound (“email-based”).

-To get started with email based authentications,
+To get started with email-based authentication,

39-44: Plural & missing comma.

-...to expose its APIs to outside client.
-For this add an `email_account_endpoint.dart` file...
+...to expose its APIs to outside clients.
+For this, add an `email_account_endpoint.dart` file...

51-52: Clarify sentence (“Overrides in this class can…”).

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

69-76: More concise wording & article order.

-In order to generate server and client the code for the newly added endpoint, run:
+To generate the server and client code for the newly added endpoint, run:

75-82: Comma after introductory adverb.

-Additionally the database schema will need to be extended
+Additionally, the database schema will need to be extended

82-84: Comma after introductory phrase.

-As the last step, the email authentication package needs to be configured.  
-For this set the `EmailAccounts.config` ...
+As the last step, the email authentication package needs to be configured.  
+For this, set `EmailAccounts.config` ...

112-116: Comma & number word.

-Basically there are 2 primary approaches possible:
+Basically, there are two primary approaches:

116-118: Typo “roatation” → “rotation”, add comma.

-Additionally you need to update ...
-... and thus a roatation would invalidate ...
+Additionally, you need to update ...
+... and thus a rotation would invalidate ...

129-133: Minor wording (“Your generated client”).

-  auth_example_client: # You generated client, name may differ
+  auth_example_client: # Your generated client, name may differ

186-197: Plural agreement & missing closing quote.

-### Authentication
-The following package provide the core authentication functionality...
+### Authentication
+The following packages provide the core authentication functionality...
...
-|`serverpod_auth_google_account`|Basic "Sign in with Google authentication.|
+|`serverpod_auth_google_account`|Basic “Sign in with Google” authentication.|
docs/08-upgrading/06-upgrading-from-serverpod_auth.md (7)

5-7: Streamline sentence (“there exists” → simpler).

-...to upgrade to the new package, there exists `serverpod_auth_migration` to facilitate moving over all authentication- and user-related data...
+...to upgrade to the new package you can use `serverpod_auth_migration` to migrate all authentication- and user-related data...

18-19: Typo “throught”.

-...disable sign-ups throught the legacy package <!-- TODO ...
+...disable sign-ups through the legacy package <!-- TODO ...

24-25: Grammar (“a single hooks”).

-...provides a single hooks which is run for each user migration...
+...provides a single hook that runs for each user migration...

28-30: Concise wording.

-In order to support both sessions created by the legacy `serverpod_auth` and through the new `serverpod_auth_session` package, the `authenticationHandler` has to be updated...
+To support sessions from both the legacy `serverpod_auth` and the new `serverpod_auth_session` package, update the `authenticationHandler`...

47-48: Plural agreement.

-All high-level authentication provider package use
+All high-level authentication provider packages use

122-127: Spelling & plural.

-The `userMigrationHook` shown above is also the place where you should migraten all references...
-Commonly there are 2 approach how this could be handled:
+The `userMigrationHook` shown above is also the place where you should migrate all references...
+Commonly there are two approaches for handling this:

127-130: Spelling “accomodated” → “accommodated”.

-...could easily be accomodated by looking for the `int` or `UUID` value...
+...could easily be accommodated by looking for the `int` or `UUID` value...
📜 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 e2f365b.

📒 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

[uncategorized] ~24-~24: A comma might be missing here.
Context: ...UIDid of theAuthUser. To support this the serverpod_auth_migration` packages...

(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)


[grammar] ~24-~24: Do not use the singular ‘a’ before the plural noun ‘hooks’.
Context: ...erpod_auth_migration` packages provides a single hooks which is run for each user migration in...

(VB_A_JJ_NNS)


[style] ~27-~27: Consider a more concise word here.
Context: ... can be migrated as well. ## Sessions In order to support both sessions created by the le...

(IN_ORDER_TO_PREMIUM)


[uncategorized] ~47-~47: The grammatical number of this noun doesn’t look right. Consider replacing it.
Context: ... All high-level authentication provider package use serverpod_auth_session under the ...

(AI_EN_LECTOR_REPLACEMENT_NOUN_NUMBER)


[style] ~57-~57: 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)


[grammar] ~124-~124: Did you mean “approaches”?
Context: ...AuthUser UUID`. Commonly there are 2 approach how this could be handled: One way wou...

(ARE_CD_NN)


[uncategorized] ~127-~127: A comma might be missing here.
Context: ...AuthUser id column. Then during the migration identify all rows belonging to the user...

(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)


[uncategorized] ~127-~127: Possible missing comma found.
Context: ...nd set their AuthUser id value. Later on the UserInfo-relation column will jus...

(AI_HYDRA_LEO_MISSING_COMMA)


[style] ~131-~131: Consider an alternative to strengthen your wording.
Context: ...tively, especially if one wants to make further changes to one schema in conjunction with the u...

(CHANGES_ADJUSTMENTS)


[style] ~131-~131: ‘in conjunction with’ might be wordy. Consider a shorter alternative.
Context: ...s to make further changes to one schema in conjunction with the user migration, one could migrate t...

(EN_WORDINESS_PREMIUM_IN_CONJUNCTION_WITH)


[uncategorized] ~132-~132: Use a comma before ‘so’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...igration for all users in a team/company so all users in that group could start usi...

(COMMA_COMPOUND_SENTENCE_2)

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

[uncategorized] ~15-~15: 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] ~25-~25: This expression is usually spelled with a hyphen.
Context: ...nstance. ## Email To get started with email based authentications, add `serverpod_auth_em...

(BASED_HYPHEN)


[style] ~39-~39: 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] ~40-~40: 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] ~69-~69: 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] ~75-~75: 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] ~82-~82: Use a comma after an introductory phrase.
Context: ...ation package needs to be configured. For this set the EmailAccounts.config (from packag...

(COMMA_INTRODUCTORY_WORDS_PHRASES)


[style] ~83-~83: 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)


[typographical] ~112-~112: Consider adding a comma after ‘Basically’ for more clarity.
Context: ...ion to decide how to use the callbacks. Basically there are 2 primary approaches possible...

(RB_LY_COMMA)


[formatting] ~113-~113: Consider inserting a comma after an introductory phrase for better readability.
Context: ...n (account creation or password reset). In that case the user could copy/paste or retype the...

(IN_THAT_CASE_COMMA)


[uncategorized] ~114-~114: A comma might be missing here.
Context: ...rification into a form on the client. - Alternatively emails could contain a deep link with b...

(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)


[uncategorized] ~115-~115: A comma may be missing after the conjunctive/linking adverb ‘Additionally’.
Context: ... original request was made on mobile). Additionally you need to update the passwords.yaml...

(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)


[typographical] ~119-~119: 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] ~190-~190: 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] ~190-~190: 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] ~190-~190: 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)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Test build
🔇 Additional comments (1)
docs/08-upgrading/06-upgrading-from-serverpod_auth.md (1)

31-36: Verify correct import path for AuthSessions.

The earlier setup guide imports serverpod_auth_email_server.
Here the snippet uses package:serverpod_auth_email/serverpod_auth_email.dart.
Double-check which one actually exposes AuthSessions; using the wrong import will cause a build error.

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: 1

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

15-15: Insert comma after introductory clause

Add a comma after “profile” for correct punctuation.

-…user profile have [a look at the underlying packages below](#low-level-building-blocks).
+…user profile, have [a look at the underlying packages below](#low-level-building-blocks).

25-25: Hyphenate compound adjective

“email based authentications” → “email-based authentication”.

-To get started with email based authentications
+To get started with email-based authentication

39-43: Tighten wording

The phrase “in order to” is verbose; “to” is sufficient.

-…file to the project in order to expose its APIs to outside client.
+…file to the project to expose its APIs to external clients.

116-118: Correct typo “roatation” and clarify sentence

-…and thus a roatation would invalidate previously created credentials.
+…and thus a rotation would invalidate previously created credentials.

112-115: Add comma after “Basically”

-Basically there are 2 primary approaches possible:
+Basically, there are two primary approaches possible:
docs/08-upgrading/06-upgrading-from-serverpod_auth.md (3)

24-25: Singular / plural agreement & missing comma

-…provides a single hooks which is run for each user migration…
+…provides a single hook, which is run for each user migration…

47-47: Pluralize “package”

-All high-level authentication provider package use…
+All high-level authentication provider packages use…

124-124: Plural noun required

-Commonly there are 2 approach how this could be handled:
+Commonly there are two approaches to handle this:
📜 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 e2f365b.

📒 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/06-concepts/11-authentication/01-setup_new.md

[uncategorized] ~15-~15: 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] ~25-~25: This expression is usually spelled with a hyphen.
Context: ...nstance. ## Email To get started with email based authentications, add `serverpod_auth_em...

(BASED_HYPHEN)


[style] ~39-~39: 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] ~40-~40: 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] ~69-~69: 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] ~75-~75: 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] ~82-~82: Use a comma after an introductory phrase.
Context: ...ation package needs to be configured. For this set the EmailAccounts.config (from packag...

(COMMA_INTRODUCTORY_WORDS_PHRASES)


[style] ~83-~83: 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)


[typographical] ~112-~112: Consider adding a comma after ‘Basically’ for more clarity.
Context: ...ion to decide how to use the callbacks. Basically there are 2 primary approaches possible...

(RB_LY_COMMA)


[formatting] ~113-~113: Consider inserting a comma after an introductory phrase for better readability.
Context: ...n (account creation or password reset). In that case the user could copy/paste or retype the...

(IN_THAT_CASE_COMMA)


[uncategorized] ~114-~114: A comma might be missing here.
Context: ...rification into a form on the client. - Alternatively emails could contain a deep link with b...

(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)


[uncategorized] ~115-~115: A comma may be missing after the conjunctive/linking adverb ‘Additionally’.
Context: ... original request was made on mobile). Additionally you need to update the passwords.yaml...

(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)


[typographical] ~119-~119: 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] ~190-~190: 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] ~190-~190: 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] ~190-~190: 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)

docs/08-upgrading/06-upgrading-from-serverpod_auth.md

[uncategorized] ~24-~24: A comma might be missing here.
Context: ...UIDid of theAuthUser. To support this the serverpod_auth_migration` packages...

(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)


[grammar] ~24-~24: Do not use the singular ‘a’ before the plural noun ‘hooks’.
Context: ...erpod_auth_migration` packages provides a single hooks which is run for each user migration in...

(VB_A_JJ_NNS)


[style] ~27-~27: Consider a more concise word here.
Context: ... can be migrated as well. ## Sessions In order to support both sessions created by the le...

(IN_ORDER_TO_PREMIUM)


[uncategorized] ~47-~47: The grammatical number of this noun doesn’t look right. Consider replacing it.
Context: ... All high-level authentication provider package use serverpod_auth_session under the ...

(AI_EN_LECTOR_REPLACEMENT_NOUN_NUMBER)


[style] ~57-~57: 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)


[grammar] ~124-~124: Did you mean “approaches”?
Context: ...AuthUser UUID`. Commonly there are 2 approach how this could be handled: One way wou...

(ARE_CD_NN)


[uncategorized] ~127-~127: A comma might be missing here.
Context: ...AuthUser id column. Then during the migration identify all rows belonging to the user...

(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)


[uncategorized] ~127-~127: Possible missing comma found.
Context: ...nd set their AuthUser id value. Later on the UserInfo-relation column will jus...

(AI_HYDRA_LEO_MISSING_COMMA)


[style] ~131-~131: Consider an alternative to strengthen your wording.
Context: ...tively, especially if one wants to make further changes to one schema in conjunction with the u...

(CHANGES_ADJUSTMENTS)


[style] ~131-~131: ‘in conjunction with’ might be wordy. Consider a shorter alternative.
Context: ...s to make further changes to one schema in conjunction with the user migration, one could migrate t...

(EN_WORDINESS_PREMIUM_IN_CONJUNCTION_WITH)


[uncategorized] ~132-~132: Use a comma before ‘so’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...igration for all users in a team/company so all users in that group could start usi...

(COMMA_COMPOUND_SENTENCE_2)

🪛 markdownlint-cli2 (0.17.2)
docs/06-concepts/11-authentication/01-setup_new.md

29-29: Multiple consecutive blank lines
Expected: 1; Actual: 2

(MD012, no-multiple-blanks)


38-38: Multiple consecutive blank lines
Expected: 1; Actual: 2

(MD012, no-multiple-blanks)


113-113: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


134-134: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)

@tp tp force-pushed the auth-migration branch from e2f365b to b7e314d Compare June 30, 2025 17:34
@tp tp requested a review from christerswahn June 30, 2025 17:34
@tp tp force-pushed the auth-migration branch from b7e314d to a414c6a Compare July 2, 2025 17:02
…rpod_auth` to the new provider using `serverpod_auth_migration`

Closes serverpod/serverpod#3663
@tp
Copy link
Contributor Author

tp commented Jul 8, 2025

@coderabbitai full review

@coderabbitai
Copy link

coderabbitai bot commented Jul 8, 2025

✅ Actions performed

Full review triggered.

@tp tp marked this pull request as ready for review July 8, 2025 15:19
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 (8)
docs/06-concepts/11-authentication/01-setup_new.md (4)

7-25: Tighten wording & fix small grammatical slips in intro section

Several phrases read a little clumsily and a couple of hyphens / commas are missing. The diff below modernises the language without changing the meaning.

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

-If you would like the basic authentication offered by these packages, but combine them with a different approach to session management or another kind of user profile have [a look at the underlying packages below](#low-level-building-blocks).
+If you'd like the basic authentication offered by these packages but want to combine it with a different session-management approach or user profile, [have a look at the underlying packages below](#low-level-building-blocks).

-Just follow any of the individual authentication provider guides to set the `AuthSessions`' `authenticationHandler` on your `Serverpod` instance.
+Just follow any of the individual provider guides and set `AuthSessions.authenticationHandler` on your `Serverpod` instance.

-To get started with email based authentication,
+To get started with email-based authentication,

39-51: Minor wording tweaks for clarity in “Server setup” paragraph

-... expose its APIs to outside client.
+... expose its APIs to external clients.

-For this add an `email_account_endpoint.dart` file to the project:
+For this, add an `email_account_endpoint.dart` file to the project:

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

70-83: Polish wording around generation & configuration steps

-In order to generate server and client the code for the newly added endpoint, run:
+Generate the server and client code for the newly added endpoint with:

-As the last step, the email authentication package needs to be configured.  
-For this set the `EmailAccounts.config` (from package `serverpod_auth_email_account_server`), which contains the business logic used by the endpoint.
+Finally, configure the email-authentication package by setting `EmailAccounts.config`
+(from `serverpod_auth_email_account_server`), which contains the business logic used
+by the endpoint.

113-117: Commas improve readability in the bullet list

-Alternatively emails could contain a deep link
+Alternatively, emails could contain a deep link

-Additionally you need to update the `passwords.yaml` file
+Additionally, update the `passwords.yaml` file
docs/08-upgrading/06-upgrading-from-serverpod_auth.md (4)

3-10: Correct typos & tighten language in opening paragraph

-Switching to the new authentication package enables you to make use of the updated and extended authentication methods (and upcoming ones like Passkeys and magic lines).  
-The new package also makes used of the recently introduced support for `UUID` primary key on all its entities. Thus in addition to migrating from the legacy package to the new ones, one also has to update all their own entities which previously referenced the `UserInfo`’s `id`.
+Switching to the new authentication packages lets you take advantage of the updated and extended methods (and upcoming ones like Passkeys and magic links).  
+The new packages also make use of the recently introduced support for `UUID` primary keys on all entities. In addition to migrating the auth package, you must update any custom entities that previously referenced `UserInfo.id`.

-The backwards compatibility package needs to kept until all relevant data has been fully migrated.[^3]
+The backwards-compatibility package needs to be kept until all relevant data has been fully migrated.[^3]

24-30: Remove double-space & misc wording

-Add the `serverpod_auth_backwards_compatibility`  module and connect its helpers in the account login methods.
+Add the `serverpod_auth_backwards_compatibility` module and connect its helpers in the account-login methods.

168-172: Pluralise “registration”

-...make sure that for example no new registration take place once the migration is underway.
+...make sure, for example, that no new registrations take place once the migration is under way.

223-226: Fix wording in session-cleanup advice

-For the sessions is might be appropriate the drop all unused ones after for example 30 days, at which points clients are probably unlikely to update and the session can be deemed abandoned.
+For sessions, it might be appropriate to drop any unused ones after, for example, 30 days, at which point clients are unlikely to update and the session can be deemed abandoned.
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 889d9d7 and 3c30a89.

📒 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

[style] ~15-~15: Consider a more concise word here.
Context: ...ate can be forced (for installed apps), in order to align with breaking changes on the API ...

(IN_ORDER_TO_PREMIUM)


[style] ~51-~51: Consider a more concise word here.
Context: ...nt #### Set up the one-time migration In order to run the migration once with the next de...

(IN_ORDER_TO_PREMIUM)


[style] ~116-~116: Consider a more concise word here.
Context: ...y the serverpod_auth_session module. In order to support importing passwords set in the ...

(IN_ORDER_TO_PREMIUM)


[style] ~203-~203: ‘in conjunction with’ might be wordy. Consider a shorter alternative.
Context: ... update and deploy the server Once (or in conjunction with, when talking about a Flutter web app) ...

(EN_WORDINESS_PREMIUM_IN_CONJUNCTION_WITH)


[style] ~235-~235: Consider replacing this phrase with the adverb “securely” to avoid wordiness.
Context: ...ng that. [^2]: As passwords are stored in a secure fashion (hashed, salted, and peppered), they ca...

(IN_A_X_MANNER)


[style] ~235-~235: Unless you want to emphasize “not”, use “cannot” which is more common.
Context: ...on (hashed, salted, and peppered), they can not be directly moved from the legacy syste...

(CAN_NOT_PREMIUM)

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

[grammar] ~1-~1: Use proper spacing conventions.
Context: # Setup (serverpod_auth_*) Serverpod comes with built-in support fo...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~3-~3: There might be a mistake here.
Context: ... email or social sign-ins and currently supports signing in with email, Google, Apple, a...

(QB_NEW_EN_OTHER)


[grammar] ~3-~3: Use proper spacing conventions.
Context: ...with email, Google, Apple, and Firebase. Future versions of the authentication mo...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~5-~5: Use proper spacing conventions.
Context: ...r contributing your code. We provide the following packages of rea...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~7-~7: There might be a mistake here.
Context: ...ovide the following packages of ready-to use authentication providers. They all i...

(QB_NEW_EN_OTHER)


[grammar] ~7-~7: There might be a mistake here.
Context: ...ile courtesy of serverpod_auth_profile, and session management through `serverp...

(QB_NEW_EN_OTHER)


[grammar] ~7-~7: Use proper spacing conventions.
Context: ...gement through serverpod_auth_session. |Package|Functionality| |-|-| |`serverpo...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~13-~13: Use proper spacing conventions.
Context: ...e "Sign in with Google" authentication.| If you would like the basic authenticati...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~15-~15: There might be a mistake here.
Context: ...authentication offered by these packages, but combine them with a different appro...

(QB_NEW_EN_OTHER)


[grammar] ~15-~15: There might be a mistake here.
Context: ...sion management or another kind of user profile have [a look at the underlying packages...

(QB_NEW_EN_OTHER)


[grammar] ~15-~15: Use proper spacing conventions.
Context: ...ages below](#low-level-building-blocks). ## Sessions When using any of the "ready-t...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~17-~17: Use proper spacing conventions.
Context: ...low-level-building-blocks). ## Sessions When using any of the "ready-to-use" aut...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~19-~19: Use proper spacing conventions.
Context: ...erpod_auth_session` is already included. Just follow any of the individual authen...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~21-~21: Use proper spacing conventions.
Context: ...onHandleron yourServerpod` instance. ## Email To get started with email based a...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~23-~23: Use proper spacing conventions.
Context: ... on your Serverpod instance. ## Email To get started with email based authenti...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~25-~25: There might be a mistake here.
Context: ...ce. ## Email To get started with email based authentication, add `serverpod_aut...

(QB_NEW_EN_OTHER)


[grammar] ~25-~25: There might be a mistake here.
Context: ...d a sign-up flow with email verification, and support logins and session manageme...

(QB_NEW_EN_OTHER)


[grammar] ~25-~25: Use proper spacing conventions.
Context: ...ration through serverpod_auth_profile. The only requirement for using this modu...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~27-~27: There might be a mistake here.
Context: ...odule is having a way to send out emails, so users can receive the initial verifi...

(QB_NEW_EN_OTHER)


[grammar] ~27-~27: Use proper spacing conventions.
Context: ... also request a password reset later on. ### Server setup Add the module as a depend...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~30-~30: Use proper spacing conventions.
Context: ...sword reset later on. ### Server setup Add the module as a dependency to the se...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~32-~32: Use proper spacing conventions.
Context: ... to the server project's pubspec.yaml. sh $ dart pub add serverpod_auth_email_server As the email auth module does not expose...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[style] ~39-~39: 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)


[grammar] ~39-~39: There might be a problem here.
Context: ... in order to expose its APIs to outside client. For this add an `email_account_endpoint....

(QB_NEW_EN_MERGED_MATCH)


[grammar] ~41-~41: There might be a mistake here.
Context: ...expose its APIs to outside client. For this add an email_account_endpoint.dart fi...

(QB_NEW_EN_OTHER)


[grammar] ~41-~41: Use proper spacing conventions.
Context: ...ount_endpoint.dartfile to the project: ```dart import 'package:serverpod_auth_email_server/serverpod_auth_email_server.dart' as email_account; /// Endpoint for email-based authentication. class EmailAccountEndpoint extends email_account.EmailAccountEndpoint {} ``` In thisclass @override`s could be us...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~51-~51: There might be a mistake here.
Context: ...nt.EmailAccountEndpoint {} ``` In this class `@override`s could be used to augment t...

(QB_NEW_EN_OTHER)


[grammar] ~51-~51: Use proper spacing conventions.
Context: ...ent the default endpoint implementation. Next, add the authentication handler to ...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~53-~53: Use proper spacing conventions.
Context: ...ation handler to the Serverpod instance. dart import 'package:serverpod_auth_email_server/serverpod_auth_email_server.dart'; void run(List<String> args) async { var pod = Serverpod( args, Protocol(), Endpoints(), authenticationHandler: AuthSessions.authenticationHandler, // Add this line ); ... } In order to generate server and client t...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[style] ~69-~69: 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)


[grammar] ~70-~70: Use articles correctly.
Context: ... ); ... } ``` In order to generate server and client the code for the newly added...

(QB_NEW_EN_OTHER_ERROR_IDS_000004)


[grammar] ~70-~70: Use correct word order.
Context: ... In order to generate server and client the code for the newly added endpoint, run:...

(QB_NEW_EN_OTHER_ERROR_IDS_000030)


[grammar] ~70-~70: Use proper spacing conventions.
Context: ... code for the newly added endpoint, run: bash $ serverpod generate Additionally, the database schema will n...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~76-~76: Use proper spacing conventions.
Context: ...on using the create-migration command. bash $ serverpod create-migration As the last step, the email authenticati...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~82-~82: Use proper spacing conventions.
Context: ...tication package needs to be configured. For this set the EmailAccounts.config ...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~83-~83: Use proper spacing conventions.
Context: ...est can be left to their default values. dart import 'package:serverpod_auth_email_server/serverpod_auth_email_server.dart'; EmailAccounts.config = EmailAccountConfig( sendRegistrationVerificationCode: ( final session, { required final email, required final accountRequestId, required final verificationCode, required final transaction, }) { // Send out actual email with the verification code }, sendPasswordResetVerificationCode: ( final session, { required final email, required final passwordResetRequestId, required final transaction, required final verificationCode, }) { // Send out actual email with the verification code }, ); If you're not hosting on Serverpod Cloud...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~110-~110: Use proper spacing conventions.
Context: ... SendGrid. It is up to the application to decide ho...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~113-~113: There might be a mistake here.
Context: ... that the client initiating the request completes the operation (account creation or pass...

(QB_NEW_EN_OTHER)


[grammar] ~113-~113: There might be a problem here.
Context: ... verification into a form on the client. - Alternatively emails could contain a deep link with b...

(QB_NEW_EN_MERGED_MATCH)


[grammar] ~114-~114: Use commas after Latin abbreviations.
Context: ...support them being opened on any device (e.g. on a desktop, even if the original requ...

(QB_NEW_EN_OTHER_ERROR_IDS_000037)


[grammar] ~114-~114: There might be a problem here.
Context: ...he original request was made on mobile). Additionally you need to update the passwords.yaml...

(QB_NEW_EN_MERGED_MATCH)


[grammar] ~116-~116: Use proper spacing conventions.
Context: ..._auth_email_account_passwordHashPepper`. These should be random and at least 10 c...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~117-~117: Use proper spacing conventions.
Context: ...validate previously created credentials. After a restart of the Serverpod the new...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~119-~119: There might be a mistake here.
Context: ...ed credentials. After a restart of the Serverpod the new endpoints will be usable from t...

(QB_NEW_EN_OTHER)


[grammar] ~119-~119: Use proper spacing conventions.
Context: ...ndpoints will be usable from the client. ### Client setup First, add a dependency on...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~121-~121: Use proper spacing conventions.
Context: ...sable from the client. ### Client setup First, add a dependency on `serverpod_au...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~123-~123: There might be a mistake here.
Context: ...on_flutterto your app'spubspec.yaml`, to be able to make use of the sessions ...

(QB_NEW_EN_OTHER)


[grammar] ~123-~123: Use proper spacing conventions.
Context: ...ted by the newly created email endpoint. yaml dependencies: flutter: sdk: flutter serverpod_flutter: ^3.0.0 auth_example_client: # You generated client, name may differ path: ../auth_example_client serverpod_auth_session_flutter: ^3.0.0 # Add this line Next, add the SessionManager to your a...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~136-~136: Use proper spacing conventions.
Context: ... it to the generated Serverpod Client. dart import 'package:serverpod_auth_session_flutter/serverpod_auth_session_flutter.dart' show SessionManager; late SessionManager sessionManager; late Client client; void main() async { // Need to call this as we are using Flutter bindings before runApp is called. WidgetsFlutterBinding.ensureInitialized(); // The session manager keeps track of the signed-in state of the user. You // can query it to see if the user is currently signed in and get information // about the user. sessionManager = SessionManager(); await sessionManager.init(); // The android emulator does not have access to the localhost of the machine. // const ipAddress = '10.0.2.2'; // Android emulator ip for the host // On a real device replace the ipAddress with the IP address of your computer. const ipAddress = 'localhost'; // Sets up a singleton client object that can be used to talk to the server from // anywhere in our app. The client is generated from your server code. // The client is set up to connect to a Serverpod running on a local server on // the default port. You will need to modify this to connect to staging or // production servers. client = Client( 'http://$ipAddress:8080/', authenticationKeyManager: sessionManager, )..connectivityMonitor = FlutterConnectivityMonitor(); runApp(MyApp()); } ### User consolidation <!-- TODO: Explain h...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~174-~174: Use proper spacing conventions.
Context: ...(MyApp()); } ``` ### User consolidation ## Low-level building blocks ### Session M...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~179-~179: Use proper spacing conventions.
Context: ...imilar --> ## Low-level building blocks ### Session Management |Package|Functionali...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~181-~181: Use proper spacing conventions.
Context: ... building blocks ### Session Management |Package|Functionality| |-|-| |`serverpo...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~186-~186: There might be a mistake here.
Context: ...emented, which can also generate access token with public/private key cryptography to...

(QB_NEW_EN_OTHER)


[grammar] ~186-~186: Use proper spacing conventions.
Context: ...ography to use with 3rd party services.| ### Authentication The following package pr...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~188-~188: Use proper spacing conventions.
Context: ...3rd party services.| ### Authentication The following package provide the core a...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~190-~190: Ensure subjects and verbs match in plurality.
Context: ...# Authentication The following package provide the core authentication functionality, ...

(QB_NEW_EN_OTHER_ERROR_IDS_000074)


[grammar] ~190-~190: There might be a mistake here.
Context: ...de the core authentication functionality, but without providing a default `Endpoi...

(QB_NEW_EN_OTHER)


[grammar] ~190-~190: There might be a mistake here.
Context: ...default Endpoint base implementation. Thus they can be combined with another sessi...

(QB_NEW_EN_OTHER)


[grammar] ~190-~190: Correctly pair commas and coordinating conjunctions.
Context: ...ckage and include further modification, like for example a custom user profile. |Pa...

(QB_NEW_EN_OTHER_ERROR_IDS_000073)


[grammar] ~190-~190: There might be a mistake here.
Context: ... include further modification, like for example a custom user profile. |Package|Functi...

(QB_NEW_EN_OTHER)


[grammar] ~190-~190: Use proper spacing conventions.
Context: ... like for example a custom user profile. |Package|Functionality| |-|-| |`serverpo...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~196-~196: Use proper spacing conventions.
Context: ...c "Sign in with Google" authentication.|

(QB_NEW_EN_OTHER_ERROR_IDS_000007)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Test build

@tp tp force-pushed the auth-migration branch from 3c30a89 to 858012d Compare July 8, 2025 15:25
Copy link
Contributor

@christerswahn christerswahn left a comment

Choose a reason for hiding this comment

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

My initial comments!

@@ -0,0 +1,237 @@
# Upgrading from `serverpod_auth`

With the release of Serverpod 3.0, the “monolith” `serverpod_auth` package was deprecated and replaced with a set of modular packages providing flexible modules for user management, authentication providers, profiles, and sessions. Switching to the new authentication package enables you to make use of the updated and extended authentication methods (and upcoming ones like Passkeys and magic lines).
Copy link
Contributor

Choose a reason for hiding this comment

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

Should it be "magic links" instead of "magic lines"?

# Upgrading from `serverpod_auth`

With the release of Serverpod 3.0, the “monolith” `serverpod_auth` package was deprecated and replaced with a set of modular packages providing flexible modules for user management, authentication providers, profiles, and sessions. Switching to the new authentication package enables you to make use of the updated and extended authentication methods (and upcoming ones like Passkeys and magic lines).
The new package also makes used of the recently introduced support for `UUID` primary key on all its entities. Thus in addition to migrating from the legacy package to the new ones, one also has to update all their own entities which previously referenced the `UserInfo`’s `id`.
Copy link
Contributor

Choose a reason for hiding this comment

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

"makes use" instead of "makes used"


We provide the following packages of ready-to-use authentication providers. They all include a basic user profile courtesy of `serverpod_auth_profile`, and session management through `serverpod_auth_session`.

|Package|Functionality|
Copy link
Contributor

Choose a reason for hiding this comment

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

These are not strictly packages, rather "package groups" (client and server) or simply "modules". Perhaps use such a name instead, less confusing for first-time readers!


In this `class` `@override`s could be used to augment the default endpoint implementation.

Next, add the authentication handler to the Serverpod instance.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion, specify file for clarity. Often this is in the server.dart file, although the user may have changed that.


After a restart of the Serverpod the new endpoints will be usable from the client.

### Client setup
Copy link
Contributor

Choose a reason for hiding this comment

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

What about the setup of the server's client package?
Shouldn't there be an addition of serverpod_auth_email_client to it's pubspec?

Comment on lines +145 to +162
/// Starts the registration for a new user account with an email-based login associated to it.
///
/// Upon successful completion of this method, an email will have been
/// sent to [email] with a verification link, which the user must open to complete the registration.
@override
Future<void> startRegistration(
final Session session, {
required final String email,
required final String password,
}) async {
await AuthBackwardsCompatibility.importLegacyPasswordIfNeeded(
session,
email: email,
password: password,
);

return super.startRegistration(session, email: email, password: password);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
/// Starts the registration for a new user account with an email-based login associated to it.
///
/// Upon successful completion of this method, an email will have been
/// sent to [email] with a verification link, which the user must open to complete the registration.
@override
Future<void> startRegistration(
final Session session, {
required final String email,
required final String password,
}) async {
await AuthBackwardsCompatibility.importLegacyPasswordIfNeeded(
session,
email: email,
password: password,
);
return super.startRegistration(session, email: email, password: password);
}

Remove this here, as the password import at this point would only be useful when login is later called, so we can just rely on the import there instead.

as email_account;

/// Endpoint for email-based authentication which imports the legacy passwords.
class PasswordImportingEmailAccountEndpoint extends email_account.EmailAccountEndpoint {
Copy link
Contributor Author

@tp tp Jul 30, 2025

Choose a reason for hiding this comment

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

Suggested change
class PasswordImportingEmailAccountEndpoint extends email_account.EmailAccountEndpoint {
class PasswordImportingEmailAccountEndpoint extends EmailAccountBaseEndpoint {

(Also update the import to reflect the no-longer-colliding names.)

6. Update the client to only use the new endpoints and the `SessionManager` from `serverpod_auth_session_flutter`. Ensure that `serverpod_auth_client` and `serverpod_auth_shared_flutter` are not used anymore.
If deploying to an app store with long lead times, prepare this well in advance, so that new updates / downloads will be able to login and register against the new APIs.
7. Once the updated app is available for users, deploy the backed and force the client to upgrade.
8. Remove the `serverpod_auth_migration` and `serverpod_auth` module from the server.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: Also mention the client side and which packages should be removed there (e.g. Flutter SessionManager).

void run(final List<String> args) async {
// Start the server.
await pod.start();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: Comment this out while the migration is running.

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]

2 participants