0

I have trouble:

  1. I've ionic 2 app, in which user need login via form
  2. Django backend with django-registration for user registration/login/etc.

Problem: Sending data via post request to django-registration login url causes 403 Forbidden error(Forbidden (CSRF token missing or incorrect.): /accounts/login/). So, my opinion, that in this case I can't fix it without changing user authentication library on backend side. But I need use those stack and those libraries. Commenting csrf middleware in settings file doesn't help. I've been tried use angular2-cookie from this answer, but it's still returning 403 error. Is there another way to solve this problem?

Community
  • 1
  • 1
Simple runner
  • 445
  • 6
  • 19
  • Have you tried sending It with post man ? - If it fails with post-man then we know its django , If it is successful then we know it's ionic 2 – LeRoy Jan 17 '17 at 07:59
  • Well, there is a problem with structure: we can't login without csrf token(in django-registration for login view uses LoginView from django.contrib.auth, which dispatch method decorated by @csrf_protect. So, in the end, we need change library for login(to rest-auth) – Simple runner Jan 17 '17 at 09:16

0 Answers0