Hi, I have just started to try Supertokens for a D...
# support-questions-legacy
d
Hi, I have just started to try Supertokens for a Django app with Angular frontend. The sign in works. I have the righr cors policy. I created a new POST api view and tested it with curl to work. However when I call the same endpoint with Angular, I get 403 Error. I have check AuthorisedHosts, CORS headers, CORS policy etc. but to no success. What I may be missing?
r
hey @dekode what is the response body?
d
{ "detail": "CSRF Failed: Origin checking failed - http://localhost:3000 does not match any trusted origins." }
r
right. I think you are using djanogo auth as well. You should remove that and just use supertokens
d
Copy code
CORS_ORIGIN_WHITELIST = [
    "http://localhost:3000"
]

CORS_ALLOW_CREDENTIALS = True
CORS_ORIGIN_ALLOW_ALL = False

ALLOWED_HOSTS = [
    # development
    'localhost',
    '127.0.0.1',
]

CORS_ALLOWED_ORIGINS = [
    "http://localhost:3000"
]

CORS_ALLOW_HEADERS: List[str] = list(default_headers) + [
    "Content-Type"
] + get_all_cors_headers()
You mean remove "'django.contrib.auth.middleware.AuthenticationMiddleware',"
r
yea i think so
d
Yes. That worked. Thanks a lot. By The way, how do I add user profiles in Django if I do not use Django user table at all
r
you can override the sign up function on the backend and add users to your table
d
I am looking fore the docs in ThirdPart Passwordless recipe. The overriding signup was there in email+password recipe
6 Views