supertokens / supertokens-flutter

Flutter SDK for SuperTokens
https://supertokens.com
Other
15 stars 10 forks source link

Refused to set unsafe header "cookie" #52

Closed akalitenya closed 10 months ago

akalitenya commented 10 months ago

Setup is passwordless (OTP token).

Supertokens-postgres 7.0.16 Backend - NestJS. Frontend - 2 apps: 1) Angular using supertokens-web-js 2) Flutter web using supertokens_flutter

Everything seems to be working as it should, but I have "Refused to set unsafe header "cookie"" error on each request from flutter web to backend.

flutter api service:

import 'package:supertokens_flutter/http.dart' as superhttp;

...

final response = await superhttp.post(
  uri,
  headers: {
    'Content-type': 'application/json',
    'rid': 'passwordless',
  },
  body: json.encode(body),
);

Screenshot 2024-01-07 at 12 19 51

rishabhpoddar commented 10 months ago

We don't support flutter web at the moment via our SDK. So you should manage tokens on your own on flutter web, and not use our interceptors from the flutter SDK.

Here is more info on managing tokens on your own: https://supertokens.com/docs/session/quick-setup/handling-session-tokens#if-not-using-our-frontend-sdk