Bird
0
0

Why is it important to validate the token signature instead of just decoding the token in NestJS?

hard📝 Conceptual Q10 of 15
NestJS - Authentication
Why is it important to validate the token signature instead of just decoding the token in NestJS?
ADecoding automatically refreshes the token
BValidation is slower and less secure than decoding
CDecoding does not verify token authenticity or integrity
DDecoding encrypts the token payload
Step-by-Step Solution
Solution:
  1. Step 1: Understand difference between decode and verify

    decode reads token data without checking if token is genuine.
  2. Step 2: Recognize importance of signature validation

    Validation ensures token was signed by trusted source and not altered.
  3. Final Answer:

    Decoding does not verify token authenticity or integrity -> Option C
  4. Quick Check:

    Validation checks authenticity; decode does not [OK]
Quick Trick: Always verify signature to trust token data [OK]
Common Mistakes:
  • Thinking decode validates token
  • Assuming decode refreshes token
  • Confusing decoding with encryption

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions