Change Authorization in the header before request #5339
-
Hello, So to explain the situation in the backend I'm receiving the JWT token encrypted ! What I want to do is to decrypt the token, replace the headers['Authorization'] with the decrypted JWT token on the before_request decorator, but I couldn't do that I tried changing it but it's not changing at all. Any ideas how can I do that ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
That seems like a strange thing to do. Why not decode it in a A HTTP header is always a string, but decoded JWT is usually a JSON object. That does not belong into |
Beta Was this translation helpful? Give feedback.
==
is comparison, not assignment.Beyond that, I'm not going to help you changing the header value since I strongly believe that you're doing the wrong thing. Store your decoded JWT elsewhere.