after few days of digging on logs, changing repositories and lots of frustration. I'm using rails api hosted on Heroku, vue front-end app also hosted on Heroku.
on authenticate post request from the vue to the rails, the error occurs. I've read this article -
Client Request Interrupted in Heroku
and all the other related articles, yet I've not seen any concrete answer
this.$http.post('/authenticate',{'email':this.user.email,'password':this.user.password},{headers:
{'Access-Control-Allow-Origin': '*'}}
).then((result)=>{
localStorage.setItem('Authorization',result.data.auth_token);
this.$http.defaults.headers.common['Authorization'] = localStorage.Authorization;
this.$router.push('/');
})
.catch(error => {
console.log(error.response);
alert("Wrong cradentials, if you dont have an account - sign in");
});
sock=client at=warning code=H27 desc="Client Request Interrupted" method=POST path="/authenticate" host=api-url request_id=9c3016cd-910a-4sd1f-9020-e0asd280e8 fwd="ip" dyno=web.1 connect=2ms service=289ms status=499 bytes= protocol=https
Sometimes the request lands successfully and everything works fine, and sometimes not. about 50\50...
if I log-in then log-out, then again log-in most of the time the problem pop out. sometimes it occurs right away on the first try and on the second it works fine. I've tried to change the parameters that sent tried all the string interpolation variation without any success.
to relate, after the post request sent with the user credentials rails run authenticate methods which confirms the user and sending back auth token as a string.