Hi,
I’m trying to implement user login system based on token. In a browser mode (chrome) it works alright (http POST request to the django server -> response with the valid token), but from my android device I’m getting error:
CSRF failed: Referer checking failed - no Referer. Status 403 Forbidden.
Any suggestions ?
Cordova CLI: 6.3.1
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.11
Ionic CLI Version: 2.0.0-beta.36
Ionic App Lib Version: 2.0.0-beta.19
OS: Windows 7 SP1
Node Version: v4.5.0
Since i’ve updated to 2.0.0 Ionic CLI i have had some problems with both emulate and on my device. Not sure why and tried downgrading again to 1.1.76 but with no success.
Is there a referer header when you deploy it in the emulator? Because that’s what you need if I read the error correctly. You can check it with the chrome remote debugging tools
In the request headers there is no ‘Referer’, referer =null while checking in the csrf validation function (probably CsrfViewMiddleware), so it must be rejected.
I suppose, the only way my app could pass a validation process is to change something on the server side