Skip to content

fix: guard null authToken before use in surgeryAPI#642

Merged
llinsss merged 1 commit into
DogStark:mainfrom
chiemezie1:feature/guard-null-authToken-surgeryAPI
Jun 25, 2026
Merged

fix: guard null authToken before use in surgeryAPI#642
llinsss merged 1 commit into
DogStark:mainfrom
chiemezie1:feature/guard-null-authToken-surgeryAPI

Conversation

@chiemezie1

Copy link
Copy Markdown
Contributor

fix(surgeryAPI): fail fast when authToken is missing or invalid

PR Description

  • Fix surgeryAPI.ts so the Axios request interceptor checks localStorage.getItem('authToken') before adding Authorization.
  • If authToken is missing, empty, or the literal string "null", the request now throws:
    • Authentication required. Please log in to continue.
  • This prevents malformed requests from sending Authorization: Bearer null to the backend.

Files changed

  • surgeryAPI.ts
  • surgeryAPI.test.ts

Closes: #588

@drips-wave

drips-wave Bot commented Jun 25, 2026

Copy link
Copy Markdown

@chiemezie1 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@llinsss llinsss merged commit d5a94bd into DogStark:main Jun 25, 2026
6 of 13 checks 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.

[Frontend] Guard Null authToken Before Use in surgeryAPI.ts

3 participants