Skip to content

fix: make token type comparison case-insensitive in authentication#77

Merged
PatrickE94 merged 1 commit intomainfrom
fix-casing
Nov 4, 2025
Merged

fix: make token type comparison case-insensitive in authentication#77
PatrickE94 merged 1 commit intomainfrom
fix-casing

Conversation

@PatrickE94
Copy link
Copy Markdown
Owner

The Zaptec API returns token_type as "bearer" (lowercase), but the code was checking for exactly "Bearer" (uppercase), causing authentication to fail. Changed the comparison to be case-insensitive using toLowerCase(). This is likely due to an API update. We now ignore casing in our comparison.

Also fixed the error message which was incorrectly showing data.token_type twice instead of displaying the expected value "Bearer".

The Zaptec API returns token_type as "bearer" (lowercase), but the code
was checking for exactly "Bearer" (uppercase), causing authentication to
fail. Changed the comparison to be case-insensitive using toLowerCase().

Also fixed the error message which was incorrectly showing data.token_type
twice instead of displaying the expected value "Bearer".
@PatrickE94 PatrickE94 merged commit 48390c4 into main Nov 4, 2025
1 check passed
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.

1 participant