Skip to content

Commit 9bcca5e

Browse files
committed
docs: clarify difference between @firebaseuser and @FirebaseUserClaims
Add a section in the README to explain the separation of `@FirebaseUser` and `@FirebaseUserClaims`. This clarification addresses potential confusion by highlighting that `@FirebaseUser` returns the full decoded token while `@FirebaseUserClaims` provides only the custom claims. Reference issue #11 for more details on this update.
1 parent 2266547 commit 9bcca5e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,16 @@ export class AppController {
207207
}
208208
}
209209
```
210+
211+
#### Difference Between `@FirebaseUser` and `@FirebaseUserClaims`
212+
213+
> **Note:** Starting from version `>=1.7.x`, these two decorators are explicitly separated to avoid confusion (see [issue #11](https://github.com/Alpha018/nestjs-firebase-auth/issues/11)):
214+
215+
- `@FirebaseUser()` → Returns the **full decoded token** (`auth.DecodedIdToken`).
216+
- `@FirebaseUserClaims()` → Returns only the **custom claims** (roles/permissions) defined for the user.
217+
218+
This separation ensures that developers can access both the raw Firebase user object and the role/claims information independently.
219+
210220
## Resources
211221

212222
Check out a few resources that may come in handy when working with NestJS:

0 commit comments

Comments
 (0)