Skip to content

feat(frontend): info toast and sign-out when new sign-ups are closed#12622

Merged
AntonioVentilii merged 9 commits intomainfrom
feat/frontend-loader-signups-closed-toast
Apr 28, 2026
Merged

feat(frontend): info toast and sign-out when new sign-ups are closed#12622
AntonioVentilii merged 9 commits intomainfrom
feat/frontend-loader-signups-closed-toast

Conversation

@AntonioVentilii
Copy link
Copy Markdown
Collaborator

@AntonioVentilii AntonioVentilii commented Apr 28, 2026

Motivation

Show a clear info toast and sign the user out when new sign-ups are restricted.

Changes

  • initLoader reads the failure reason from loadUserProfile. On signups-closed, shows an info toast and calls signOut({ resetUrl: true, source: 'signups-closed' }).
  • New auth.info.signups_closed i18n key (synced across locales).

Tests

Added tests.

When `loadUserProfile` reports a `signups-closed` failure reason in
`initLoader`, show an info toast ("New sign-ups are currently
restricted...") and sign the user out with `resetUrl: true` and
`source: 'signups-closed'`. Other load failures keep the existing
behavior. Adds the new `auth.info.signups_closed` i18n key (synced
across locales).
@AntonioVentilii AntonioVentilii marked this pull request as ready for review April 28, 2026 07:36
@AntonioVentilii AntonioVentilii requested a review from a team as a code owner April 28, 2026 07:36
Copilot AI review requested due to automatic review settings April 28, 2026 07:36
Comment thread src/frontend/src/lib/services/loader.services.ts Outdated
Comment thread src/frontend/src/lib/services/loader.services.ts
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a dedicated “sign-ups closed” handling path during frontend initialization so users get an informational message and are signed out when profile creation is restricted.

Changes:

  • Update initLoader to react to a signups-closed failure reason from loadUserProfile, show an info toast, and sign out with tracking metadata.
  • Add a new auth.info.signups_closed i18n key and sync it across locales.
  • Add a unit test covering the “signups closed” sign-out + toast behavior.

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/frontend/src/lib/services/loader.services.ts Adds conditional toast + sign-out behavior based on a loadUserProfile error reason.
src/frontend/src/tests/lib/services/loader.services.spec.ts Adds a unit test for the “signups closed” loader path.
src/frontend/src/lib/types/i18n.d.ts Extends i18n typings with auth.info.signups_closed.
src/frontend/src/lib/i18n/en.json Adds English copy for auth.info.signups_closed.
src/frontend/src/lib/i18n/ar.json Adds auth.info.signups_closed placeholder.
src/frontend/src/lib/i18n/cs.json Adds auth.info.signups_closed placeholder.
src/frontend/src/lib/i18n/de.json Adds auth.info.signups_closed placeholder.
src/frontend/src/lib/i18n/es.json Adds auth.info.signups_closed placeholder.
src/frontend/src/lib/i18n/fr.json Adds auth.info.signups_closed placeholder.
src/frontend/src/lib/i18n/hi.json Adds auth.info.signups_closed placeholder.
src/frontend/src/lib/i18n/it.json Adds auth.info.signups_closed placeholder.
src/frontend/src/lib/i18n/ja.json Adds auth.info.signups_closed placeholder.
src/frontend/src/lib/i18n/ko-KR.json Adds auth.info.signups_closed placeholder.
src/frontend/src/lib/i18n/pl.json Adds auth.info.signups_closed placeholder.
src/frontend/src/lib/i18n/pt.json Adds auth.info.signups_closed placeholder.
src/frontend/src/lib/i18n/ru.json Adds auth.info.signups_closed placeholder.
src/frontend/src/lib/i18n/vi.json Adds auth.info.signups_closed placeholder.
src/frontend/src/lib/i18n/zh-CN.json Adds auth.info.signups_closed placeholder.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/frontend/src/lib/services/loader.services.ts
Comment thread src/frontend/src/lib/services/loader.services.ts Outdated
Comment thread src/frontend/src/tests/lib/services/loader.services.spec.ts
AntonioVentilii and others added 2 commits April 28, 2026 09:54
`signOut` ultimately calls `window.location.reload()`, so a toast shown
right before it would never reach the user. Mirror the
`errorSignOut`/`warnSignOut` pattern with a new `infoSignOut` helper that
passes the message through `logout({ msg })`, letting it survive the
reload via `displayAndCleanLogoutMsg`.
Comment thread src/frontend/src/lib/services/loader.services.ts
Comment thread src/frontend/src/lib/services/loader.services.ts
@AntonioVentilii AntonioVentilii added this pull request to the merge queue Apr 28, 2026
Merged via the queue into main with commit d205f56 Apr 28, 2026
81 checks passed
@AntonioVentilii AntonioVentilii deleted the feat/frontend-loader-signups-closed-toast branch April 28, 2026 08:38
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.

3 participants