Skip to content

Error handling#18

Merged
Zaiidmo merged 20 commits intomasterfrom
error-handling
Feb 4, 2026
Merged

Error handling#18
Zaiidmo merged 20 commits intomasterfrom
error-handling

Conversation

@a-elkhiraooui-ciscode
Copy link
Copy Markdown
Contributor

Summary

  • What does this PR change?

Why

  • Why is this change needed?

Checklist

  • Added/updated tests (if behavior changed)
  • npm run lint passes
  • npm run typecheck passes
  • npm test passes
  • npm run build passes
  • Added a changeset (npx changeset) if this affects consumers

Notes

  • Anything reviewers should pay attention to?

@a-elkhiraooui-ciscode a-elkhiraooui-ciscode requested review from a team and Copilot February 4, 2026 09:25
Copy link
Copy Markdown

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

This PR consolidates error handling across authentication pages by introducing a centralized error message extraction utility. The changes replace scattered, inconsistent error handling logic with a single extractHttpErrorMessage function that standardizes how HTTP errors are processed and displayed to users.

Changes:

  • Added extractHttpErrorMessage utility to extract user-facing error messages from various HTTP error response shapes
  • Updated all authentication pages (SignIn, SignUp, ForgotPassword, ResetPassword) to use the centralized error helper
  • Added interceptor integration to surface refresh token errors via sessionStorage for display on the login page

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/utils/errorHelpers.ts New utility for extracting standardized error messages from HTTP responses
src/utils/attachAuthInterceptor.ts Captures refresh token errors and stores them in sessionStorage for display
src/pages/auth/SignInPage.tsx Replaces status-code-based error handling with centralized utility and displays stored auth errors
src/pages/auth/SignUpPage.tsx Removes status-specific error mapping in favor of centralized extraction
src/pages/auth/ResetPasswordPage.tsx Simplifies error handling by delegating to extraction utility
src/pages/auth/ForgotPasswordPage.tsx Changes from generic success message to displaying actual backend errors
package.json Version bump to 1.0.13

Comment thread src/utils/errorHelpers.ts
Comment thread src/pages/auth/ForgotPasswordPage.tsx
Comment thread src/utils/attachAuthInterceptor.ts
@Zaiidmo Zaiidmo merged commit ff17360 into master Feb 4, 2026
1 check passed
@Zaiidmo Zaiidmo deleted the error-handling branch February 4, 2026 09:29
saadmoumou added a commit that referenced this pull request Apr 17, 2026
* Updated workflows  (#10)

* ops: updated release pipeline to run only on version changes, and created ci workflow

* 1.0.8

* docs(workflow): add Git Flow and npm version requirements (#11)

- Add Git Flow branching strategy (develop/master)
- Document npm version command before push
- Add prepublishOnly hook recommendation
- Update workflow with proper branch management
- Clear warnings about PR targeting

Co-authored-by: Reda Channa <r.channa@ciscod.com>
Co-authored-by: Zaiid Moumni <141942826+Zaiidmo@users.noreply.github.com>

* docs: added different documentations

* 1.0.9

* ops: updated publishing trigger

* Fix/verify email UI (#13)

* parents translate, components receive plain strings

* 1.0.3

* tested in local, bug fixed

* 1.0.4

* forgot and reset password done

* 1.0.6

* verify email page done

* merged

* Unit tests (#17)

* parents translate, components receive plain strings

* 1.0.3

* tested in local, bug fixed

* 1.0.4

* forgot and reset password done

* 1.0.6

* verify email page done

* merged

* 1.0.10

* updated endpoints

* show profile updated to match new response

* added unit tests

* 1.0.12

* Error handling (#18)

* parents translate, components receive plain strings

* 1.0.3

* tested in local, bug fixed

* 1.0.4

* forgot and reset password done

* 1.0.6

* verify email page done

* merged

* 1.0.10

* updated endpoints

* show profile updated to match new response

* added unit tests

* added error handling to forgot password, reset password and signin/up page

* 1.0.13

* feat(auth): add dynamic signup fields and custom endpoints

* refactor(ui): cleanup imports and formatting in auth pages

* fix(auth): remove accessToken from bootstrap useEffect deps to prevent logout bounce-back

* fix: resolve lint errors, test failures and add eslint + prettier devDependencies

* chore: bump version to 1.0.15

---------

Co-authored-by: Zaiid Moumni <141942826+Zaiidmo@users.noreply.github.com>
Co-authored-by: Ciscode-Admin <info@ciscod.com>
Co-authored-by: Reda Channa <r.channa@ciscod.com>
Co-authored-by: Zaiidmo <zaiidmoumnii@gmail.com>
Co-authored-by: a-elkhiraooui-ciscode <a.elkhiraoui@ciscod.com>
Co-authored-by: saad moumou <saad.moumou.coder@gmail.com>
saadmoumou added a commit that referenced this pull request Apr 20, 2026
* Updated workflows  (#10)

* ops: updated release pipeline to run only on version changes, and created ci workflow

* 1.0.8

* docs(workflow): add Git Flow and npm version requirements (#11)

- Add Git Flow branching strategy (develop/master)
- Document npm version command before push
- Add prepublishOnly hook recommendation
- Update workflow with proper branch management
- Clear warnings about PR targeting

Co-authored-by: Reda Channa <r.channa@ciscod.com>
Co-authored-by: Zaiid Moumni <141942826+Zaiidmo@users.noreply.github.com>

* docs: added different documentations

* 1.0.9

* ops: updated publishing trigger

* Fix/verify email UI (#13)

* parents translate, components receive plain strings

* 1.0.3

* tested in local, bug fixed

* 1.0.4

* forgot and reset password done

* 1.0.6

* verify email page done

* merged

* Unit tests (#17)

* parents translate, components receive plain strings

* 1.0.3

* tested in local, bug fixed

* 1.0.4

* forgot and reset password done

* 1.0.6

* verify email page done

* merged

* 1.0.10

* updated endpoints

* show profile updated to match new response

* added unit tests

* 1.0.12

* Error handling (#18)

* parents translate, components receive plain strings

* 1.0.3

* tested in local, bug fixed

* 1.0.4

* forgot and reset password done

* 1.0.6

* verify email page done

* merged

* 1.0.10

* updated endpoints

* show profile updated to match new response

* added unit tests

* added error handling to forgot password, reset password and signin/up page

* 1.0.13

* feat(auth): add dynamic signup fields and custom endpoints

* refactor(ui): cleanup imports and formatting in auth pages

* fix(auth): remove accessToken from bootstrap useEffect deps to prevent logout bounce-back

* fix: resolve lint errors, test failures and add eslint + prettier devDependencies

* chore: bump version to 1.0.15

* test: enhance coverage for AuthKit-UI + fix typecheck and test:cov script

- Fix typecheck: add paths aliases to resolve @types/react dual-version conflict
- Fix test:cov script: use 'vitest run --coverage' (was watch mode)
- Add vitest coverage config: include src/**, exclude models/assets
- Add tests/utils/errorHelpers.test.ts: 9 tests covering extractHttpErrorMessage
- Add tests/components/SocialButton.test.tsx: 3 tests for SocialButton render
- Add tests/components/ProfilePage.test.tsx: 7 tests (load, edit, save, cancel, error toast)
- Add tests/pages/auth/authPages.test.tsx: tests for ForgotPassword, ResetPassword, VerifyEmail, GoogleCallback, SignIn, SignUp pages
- Add tests/exports.test.ts: smoke test for src/main/app re-exports

Coverage: 28.81%% -> 85%% statements

* fix: replace deprecated JSX.Element with React.ReactElement in AuthProvider

* fix: upgrade @types/react-dom to ^19 to fix npm ci lock file mismatch

---------

Co-authored-by: Zaiid Moumni <141942826+Zaiidmo@users.noreply.github.com>
Co-authored-by: Ciscode-Admin <info@ciscod.com>
Co-authored-by: Reda Channa <r.channa@ciscod.com>
Co-authored-by: Zaiidmo <zaiidmoumnii@gmail.com>
Co-authored-by: a-elkhiraooui-ciscode <a.elkhiraoui@ciscod.com>
Co-authored-by: saad moumou <saad.moumou.coder@gmail.com>
Zaiidmo added a commit that referenced this pull request Apr 20, 2026
* chore: standardize package workflows and ci/cd configuration

- Replace non-standard ci.yml with standardized release-check.yml and pr-validation.yml
- Create dependabot.yml for automated dependency management (weekly, 5 PR limit)
- Add sonarqube_mcp.instructions.md for SonarQube MCP server guidance
- Ensure consistent GitHub Actions versions (v4 for checkout and setup-node)
- Configure standardized Node versions (v22 for release, v20 for validation/publish)
- Pin SonarQube actions to commit SHA for security hardening
- Standardize branch triggers ([master, main] for release, [develop] for validation)

This aligns AuthKit-UI with the standardized CI/CD pattern used across all @ciscode/* packages.

* ops: added sonarqube_mcp-instructions

* chore: standardize npm scripts (lint, format, typecheck, test, build, clean, verify, prepublishOnly)

* chore: Standardize ESLint and Prettier configs with best practices

* chore: added comprehensive changesets for release automation

* docs: add standardized instruction files structure

- Add comprehensive instruction files in .github/instructions/
- Includes copilot, testing, bugfix, features, general guidelines
- Standardize documentation across all repositories

* refactor: move instruction files to .github/instructions/

- Remove deprecated instruction files from .github/ root
- Consolidate all docs in .github/instructions/ directory
- Improve documentation organization

* ops: UPDATED publish workflow and dependabot PR limits

* ops (ci): standardize publish validation and dependabot across all packages

- Replace git tag --list strategy with package.json-driven tag validation
  in all 16 publish workflows; use git rev-parse to verify the exact tag
  exists rather than guessing the latest repo-wide tag
- Update error guidance to reflect feat/** → develop → master flow
- Standardize dependabot to npm-only, grouped, monthly cadence across
  all 16 packages; remove github-actions ecosystem updates
- Add missing dependabot.yml to AuthKit-UI, ChartKit-UI, HealthKit,
  HooksKit, paymentkit, StorageKit

* security: added CODEOWNER file for branches security

* ops: updated relese check workflow#

* ci: update release check workflow

* ops: updated release check jobs ]

* Bugfix/fix auth bootstrap bounce (#19)

* Updated workflows  (#10)

* ops: updated release pipeline to run only on version changes, and created ci workflow

* 1.0.8

* docs(workflow): add Git Flow and npm version requirements (#11)

- Add Git Flow branching strategy (develop/master)
- Document npm version command before push
- Add prepublishOnly hook recommendation
- Update workflow with proper branch management
- Clear warnings about PR targeting

Co-authored-by: Reda Channa <r.channa@ciscod.com>
Co-authored-by: Zaiid Moumni <141942826+Zaiidmo@users.noreply.github.com>

* docs: added different documentations

* 1.0.9

* ops: updated publishing trigger

* Fix/verify email UI (#13)

* parents translate, components receive plain strings

* 1.0.3

* tested in local, bug fixed

* 1.0.4

* forgot and reset password done

* 1.0.6

* verify email page done

* merged

* Unit tests (#17)

* parents translate, components receive plain strings

* 1.0.3

* tested in local, bug fixed

* 1.0.4

* forgot and reset password done

* 1.0.6

* verify email page done

* merged

* 1.0.10

* updated endpoints

* show profile updated to match new response

* added unit tests

* 1.0.12

* Error handling (#18)

* parents translate, components receive plain strings

* 1.0.3

* tested in local, bug fixed

* 1.0.4

* forgot and reset password done

* 1.0.6

* verify email page done

* merged

* 1.0.10

* updated endpoints

* show profile updated to match new response

* added unit tests

* added error handling to forgot password, reset password and signin/up page

* 1.0.13

* feat(auth): add dynamic signup fields and custom endpoints

* refactor(ui): cleanup imports and formatting in auth pages

* fix(auth): remove accessToken from bootstrap useEffect deps to prevent logout bounce-back

* fix: resolve lint errors, test failures and add eslint + prettier devDependencies

* chore: bump version to 1.0.15

---------

Co-authored-by: Zaiid Moumni <141942826+Zaiidmo@users.noreply.github.com>
Co-authored-by: Ciscode-Admin <info@ciscod.com>
Co-authored-by: Reda Channa <r.channa@ciscod.com>
Co-authored-by: Zaiidmo <zaiidmoumnii@gmail.com>
Co-authored-by: a-elkhiraooui-ciscode <a.elkhiraoui@ciscod.com>
Co-authored-by: saad moumou <saad.moumou.coder@gmail.com>

* Bugfix/fix auth bootstrap bounce (#22)

* Updated workflows  (#10)

* ops: updated release pipeline to run only on version changes, and created ci workflow

* 1.0.8

* docs(workflow): add Git Flow and npm version requirements (#11)

- Add Git Flow branching strategy (develop/master)
- Document npm version command before push
- Add prepublishOnly hook recommendation
- Update workflow with proper branch management
- Clear warnings about PR targeting

Co-authored-by: Reda Channa <r.channa@ciscod.com>
Co-authored-by: Zaiid Moumni <141942826+Zaiidmo@users.noreply.github.com>

* docs: added different documentations

* 1.0.9

* ops: updated publishing trigger

* Fix/verify email UI (#13)

* parents translate, components receive plain strings

* 1.0.3

* tested in local, bug fixed

* 1.0.4

* forgot and reset password done

* 1.0.6

* verify email page done

* merged

* Unit tests (#17)

* parents translate, components receive plain strings

* 1.0.3

* tested in local, bug fixed

* 1.0.4

* forgot and reset password done

* 1.0.6

* verify email page done

* merged

* 1.0.10

* updated endpoints

* show profile updated to match new response

* added unit tests

* 1.0.12

* Error handling (#18)

* parents translate, components receive plain strings

* 1.0.3

* tested in local, bug fixed

* 1.0.4

* forgot and reset password done

* 1.0.6

* verify email page done

* merged

* 1.0.10

* updated endpoints

* show profile updated to match new response

* added unit tests

* added error handling to forgot password, reset password and signin/up page

* 1.0.13

* feat(auth): add dynamic signup fields and custom endpoints

* refactor(ui): cleanup imports and formatting in auth pages

* fix(auth): remove accessToken from bootstrap useEffect deps to prevent logout bounce-back

* fix: resolve lint errors, test failures and add eslint + prettier devDependencies

* chore: bump version to 1.0.15

* test: enhance coverage for AuthKit-UI + fix typecheck and test:cov script

- Fix typecheck: add paths aliases to resolve @types/react dual-version conflict
- Fix test:cov script: use 'vitest run --coverage' (was watch mode)
- Add vitest coverage config: include src/**, exclude models/assets
- Add tests/utils/errorHelpers.test.ts: 9 tests covering extractHttpErrorMessage
- Add tests/components/SocialButton.test.tsx: 3 tests for SocialButton render
- Add tests/components/ProfilePage.test.tsx: 7 tests (load, edit, save, cancel, error toast)
- Add tests/pages/auth/authPages.test.tsx: tests for ForgotPassword, ResetPassword, VerifyEmail, GoogleCallback, SignIn, SignUp pages
- Add tests/exports.test.ts: smoke test for src/main/app re-exports

Coverage: 28.81%% -> 85%% statements

* fix: replace deprecated JSX.Element with React.ReactElement in AuthProvider

* fix: upgrade @types/react-dom to ^19 to fix npm ci lock file mismatch

---------

Co-authored-by: Zaiid Moumni <141942826+Zaiidmo@users.noreply.github.com>
Co-authored-by: Ciscode-Admin <info@ciscod.com>
Co-authored-by: Reda Channa <r.channa@ciscod.com>
Co-authored-by: Zaiidmo <zaiidmoumnii@gmail.com>
Co-authored-by: a-elkhiraooui-ciscode <a.elkhiraoui@ciscod.com>
Co-authored-by: saad moumou <saad.moumou.coder@gmail.com>

* fix(security): upgrade axios >=1.14.1 and override follow-redirects >=1.15.12 to fix CVEs

* style: apply prettier formatting to all files

* fix(ci): correct sonar.tests path from 'test' to 'tests' and add .tsx inclusions

* fix(ci): gate SonarCloud job to workflow_dispatch only, matching WidgetKit-UI pattern

* added release check

* style: prettier format release-check.yml

---------

Co-authored-by: Zaiidmo <zaiidmoumnii@gmail.com>
Co-authored-by: Zaiid Moumni <141942826+Zaiidmo@users.noreply.github.com>
Co-authored-by: Ciscode-Admin <info@ciscod.com>
Co-authored-by: Reda Channa <r.channa@ciscod.com>
Co-authored-by: a-elkhiraooui-ciscode <a.elkhiraoui@ciscod.com>
Co-authored-by: saad moumou <saad.moumou.coder@gmail.com>
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