79241874

Date: 2024-12-01 15:24:32
Score: 1
Natty:
Report link

You are getting 404 NOT FOUND because you don't have, in your Flask code, /login route.

Your path /api/influencer/profile exists and is perfectly fine, but when you get to it, decorator @auth_required('token') checks if the query is properly authorised. For some reason it fails authorisation. Then, accordingly to flask-secure documentation, auth_required calls unauthn_handler, which "will return a 401 response if the request was JSON, otherwise will redirect to the login view." It tries to redirect the user to login view, fail to find login view (because you haven't implemented it in Flask) and this failure throws 404 Not Found error.

This is my understanding of your problem, please note that I've got it through brief reading of flask-secure documentation - I don't have personal experience with this module.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Nikolajs Petrovs