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

bufferoverflow's avatar

Session expired modal appearing after axios request only on production

I have a axios request in a Vue component for searching images in Unsplash. It workfs perfect on localhost but on production shows the Session expired modal and redirects you to the login page.

            async getImages() {
                if (this.term.length > 2) {

                    this.searching = true;

                    axios.get(this.fullEndpoint)
                        .then(response => {

                            this.results = response.data.results;
                            this.searching = false;
                        })
                        .catch(error => console.log(error));
                }
            }

Any ideas? Thanks!

0 likes
1 reply
bufferoverflow's avatar
bufferoverflow
OP
Best Answer
Level 7

Find out that the component's "unsplashKey" prop was not being filled from my env file, even after pa config:clear.

So I moved my public keys from the .env file to a config file and it's working now :)

Please or to participate in this conversation.