Skip to content

Conversation

@Alpha018
Copy link
Owner

No description provided.

@Alpha018 Alpha018 self-assigned this Sep 17, 2025
@Alpha018 Alpha018 added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request labels Sep 17, 2025
…husky setup

Update the npm script from `postinstall` to `prepare` in `package.json` to ensure husky hooks
trigger correctly. Use `|| exit 0` to avoid errors during execution when husky is not present.
Refactor the existing `setClaims` endpoint to `setRoleClaims` to distinguish between generic
claims and role-based claims. Introduce a new `setClaims` endpoint for setting generic claims.
Add corresponding get endpoints for retrieving both roles and claims, enhancing clarity in
API usage.

docs(README): update documentation with new role claims functionality

Update the README to reflect changes in API calls such as `setClaimsRoleBase` and details for
handling custom claims with `rolesClaimKey`. Clarify examples provided for role-based access
control to match the updated function signatures.

test(app-local-validation.e2e-spec.ts): enhance e2e tests with local environment variable support

Introduce `FIREBASE_TEST_USER_LOCAL` environment variable for improved test isolation.
Add additional test cases for new set and get claims functions to ensure comprehensive coverage.

fix(firebase.guard): refactor token verification and role handling logic

Improve token verification by abstracting logic into `verifyToken` for cleaner error handling.
Refactor role validation to a dedicated method `handleRoleValidation` to modularize complex
logic and improve maintainability.

miscellaneous:
- Add mock for custom claims to support testing scenarios.
- Update the FirebaseProvider to handle different keys for roles, supporting flexible claim
structures.
Update the method to retrieve decoded ID token and role claims using
`@FirebaseUser` and `@FirebaseRolesClaims` decorators. Remove outdated
example in `README.md`. Add documentation for `FirebaseRolesClaims`
decorator and mark `FirebaseUserClaims` as deprecated in code comments.

This change enhances clarity and simplifies role claims extraction
for users.
@Alpha018
Copy link
Owner Author

🎉 This PR is included in version 1.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request released

Projects

None yet

2 participants