Skip to content

1.11.0

Latest

Choose a tag to compare

@github-actions github-actions released this 04 Dec 20:43
56117b6

Added

  • A team invitation now opens to a preview that fits whoever clicked it, so a guest, an unregistered invitee, a signed-in invitee and a signed-in stranger each reach the team or see the next step. MagicStarterTeamInvitationAcceptView loads the backend's public GET /invitations/{token} (team name, inviter or null, invited address, role, expiry) before asking for anything. A visitor with no session, or only a guest-auth one, gets "Create account" (the register route with next, email and invitation in the query; only with registration on) and "Sign in" (the login route with next), and the invitation is where they land afterwards. A signed-in visitor whose email matches gets "Join :team". A signed-in visitor whose email differs sees both addresses with "Join with this account", which repeats the accept with confirm_email_mismatch: true, and "Use another account", which signs out and opens the sign-in screen with a next back to the invitation. A 403 wrong_email keeps the server's message and offers only "Use another account"; a 410 and a 404 get their own "Invitation expired" and "Invitation not found" cards. MagicStarterTeamController gains fetchInvitationPreview(token), useAnotherAccount(token) and the state invitationPreview, invitationIssue and invitationMaskedEmail, with the new MagicStarterInvitationPreview and MagicStarterInvitationIssue (notFound, expired, emailMismatch, wrongEmail). It needs the next magic-starter-laravel release, which adds the preview endpoint and the 409 email_mismatch, 403 wrong_email and 410 answers of the accept call. The English copy ships as teams.invitation_* in assets/stubs/install/en.stub; an app installed earlier merges the thirteen keys into its own lang files. lib/src/ui/views/teams/magic_starter_team_invitation_accept_view.dart, lib/src/http/controllers/magic_starter_team_controller.dart, lib/src/routes/team_routes.dart, assets/stubs/install/en.stub, doc/basics/teams.md, doc/basics/views-and-layouts.md, doc/architecture/controllers.md, skills/magic-starter/
  • Registering from an invitation link fills the invited address and joins the team in the same step. MagicStarterRegisterView reads ?email= into the email field and ?invitation= once when it opens, and MagicStarterAuthController.doRegister takes the new invitation argument, sent as invitation while teams is on. When the answer logs the user in and carries a top-level joined_team, the controller drops an intended url that points at the invitation, shows teams.invite_accepted and lands home through navigateHome(); a registration without that answer behaves as before. NavigatesRoutes gains forgetIntendedPath(path), which drops the stored intended url when its path is path and keeps any other. lib/src/ui/views/auth/magic_starter_register_view.dart, lib/src/http/controllers/magic_starter_auth_controller.dart, lib/src/http/controllers/concerns/navigates_routes.dart, doc/basics/authentication.md, doc/architecture/controllers.md, skills/magic-starter/

Changed

  • Every layout.guest group registers under the new MagicStarterLayoutIds.guest, so the signed-out pages share one shell ahead of the app shell. go_router takes the first match, and a guest page registered after the app shell (the invitation page, in its own shell) lost to a host's signed-in catch-all such as /:path(.*) behind auth, which sent a signed-out invitee to sign-in. The sign-in screens, email verification, handoff, device approval and the invitation now merge into the shell of the first guest group, the sign-in screens, which registerMagicStarterAuthRoutes() registers before the app shell; moving between them no longer swaps the shell either. A host's own guest-card group should use the same id. lib/src/routes/layout_ids.dart, lib/src/routes/auth_routes.dart, lib/src/routes/team_routes.dart, test/routes/team_routes_test.dart, test/routes/layout_ids_test.dart
  • /invitations/:token/accept is no longer behind auth; it renders in layout.guest. A signed-out invitee used to be bounced to sign-in before the invitation showed. registerMagicStarterTeamRoutes() now registers the accept page in its own group with no middleware and layout.guest, while create and settings stay behind auth in layout.app. A host that overrides teams.invitation_accept has to handle a visitor with no session (read Auth.check() and MagicStarter.isGuest()). lib/src/routes/team_routes.dart, test/routes/team_routes_test.dart, doc/basics/teams.md, doc/basics/views-and-layouts.md, skills/magic-starter/references/controllers-and-routes.md
  • MagicStarterTeamController.doAcceptInvitation navigates home by itself and takes confirmEmailMismatch. On success it restores the session, toasts teams.invite_accepted, drops an intended url pointing at the invitation and calls navigateHome(), so the view no longer navigates; a host view that did MagicRoute.to(homeRoute) after a true answer has to stop, or it navigates twice. confirmEmailMismatch: true sends {confirm_email_mismatch: true} in the body. A 409 email_mismatch is not an error: it answers false and sets invitationIssue and invitationMaskedEmail for the view to ask. The controller now mixes in NavigatesRoutes. lib/src/http/controllers/magic_starter_team_controller.dart, doc/basics/teams.md, doc/architecture/controllers.md, skills/magic-starter/references/controllers-and-routes.md