Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

bobbbbb's avatar

Use jwt.auth with Laravel vapor signed-storage-url

Using Tymon jwt tokens for auth. Laravel works fine.

When using the upload to S3 code for Laravel vapor I cannot get the signed-storage-url to use my axios defaults: axios.defaults.headers.common["Authorization"] = Bearer ${token}

something to do with the npm module not being in the correct scope.

I have overridden the vapor-core signed-storage-url controller to use the token and can get that to work no problem. It is calling Vapor.store that doesn't add the token to the axios call

0 likes
5 replies
alexrma's avatar

Hi, I have the same problem, do you have any solution?

alexrma's avatar

Ok, thnks for answer, i try this solution yesterday but anything go wrong. when do: Vapor.store(this.$refs.file.files[0], { progress: progress => { this.uploadProgress = Math.round(progress * 100); }, allways return CSRF token mistmatch (error 419). Can you detail process or show me the code? Thanks for all

alexrma's avatar

Hi, I have noticed one thing, the first call after logging in, everything always works ok, from then on it no longer works

Please or to participate in this conversation.