andrewbyrley
09/20/2023, 11:35 AMrp_st
09/20/2023, 11:37 AMrp_st
09/20/2023, 11:37 AMandrewbyrley
09/20/2023, 11:39 AMrp_st
09/20/2023, 11:40 AMandrewbyrley
09/20/2023, 11:42 AMandrewbyrley
09/20/2023, 11:43 AMrp_st
09/20/2023, 11:59 AMnkshah2
09/21/2023, 5:16 AMnkshah2
09/21/2023, 5:16 AMandrewbyrley
09/21/2023, 12:19 PMflutter: API_DOMAIN is:
flutter: http://localhost:8000
As far as platform, I'm not 100% what you're asking, but I'm on ubuntu running supertokens_flutter (0.2.7) via VScode. Backend is supertokens_python (0.15.2)nkshah2
09/22/2023, 4:54 AMnkshah2
09/22/2023, 4:54 AMandrewbyrley
09/22/2023, 4:54 AMnkshah2
09/22/2023, 4:54 AMnkshah2
09/22/2023, 4:55 AMandrewbyrley
09/22/2023, 4:55 AMandrewbyrley
09/22/2023, 4:55 AMnkshah2
09/22/2023, 4:56 AMandrewbyrley
09/24/2023, 3:30 PMlocalhost
to 10.0.2.2
.andrewbyrley
09/24/2023, 3:35 PM{status: OK, user: {id: fXXXX25c-XXXX-XXXX-a4b4-XXXXXXXXea84, email: this-is-the-email@gmail.com, timeJoined: 16684XXX46244}}
But calling bool sessionExists = await SuperTokens.doesSessionExist();
after logging in returns false
nkshah2
09/25/2023, 4:50 AMandrewbyrley
09/25/2023, 5:39 AMlocalhost
, even when the flutter client is reaching out to 10.0.2.2, so I didn't change the IP on the frontend. I'll try that and report back.nkshah2
09/25/2023, 5:40 AMandrewbyrley
09/25/2023, 4:35 PMom.supertokens {"t": "2023-09-25T16:33:00.401Z", "sdkVer": "0.15.2", "message": "getSession: UNAUTHORISED because accessToken in request is undefined", "file": "recipe/session/recipe_implementation.py:200"}
andrewbyrley
09/25/2023, 4:35 PMnkshah2
09/26/2023, 4:36 AMnkshah2
09/26/2023, 4:37 AMandrewbyrley
09/26/2023, 5:37 AMnkshah2
09/26/2023, 5:38 AMandrewbyrley
09/26/2023, 7:23 AM{
"message": "unauthorised"
}
andrewbyrley
09/26/2023, 7:24 AMnkshah2
09/26/2023, 7:42 AMandrewbyrley
09/26/2023, 7:53 AMandrewbyrley
09/26/2023, 8:02 AMnkshah2
09/26/2023, 8:32 AMandrewbyrley
09/26/2023, 8:38 AMnkshah2
09/26/2023, 8:39 AMandrewbyrley
09/26/2023, 8:42 AMvoid sendLoginToSuperTokens(
String email, String password, BuildContext context) async {
if (kDebugMode) {
print(email);
print(password);
}
var response = await http.post(
Uri.parse('${dotenv.env['API_DOMAIN']}/auth/signin'),
headers: <String, String>{
'rid': 'thirdpartyemailpassword',
'Content-Type': 'application/json; charset=utf-8',
},
body: jsonEncode(
<String, List<Map<String, String>>>{
'formFields': [
{
'id': 'email',
'value': email,
},
{
'id': 'password',
'value': password,
},
],
},
),
);
if (kDebugMode) {
// print(jsonDecode(response.body)['message']);
print(jsonDecode(response.body));
}
if (jsonDecode(response.body)['status'] == 'OK') {
// Navigate to home screen
var isLoggedIn = await SuperTokens.doesSessionExist();
if (kDebugMode) {
print('isLoggedIn is');
print(isLoggedIn);
}
Navigator.of(context)
.pushReplacement(MaterialPageRoute(builder: (context) => const Home()));
} else {
// Show error message
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text("ruh roh"),
),
);
}
}
andrewbyrley
09/26/2023, 8:43 AMnkshah2
09/26/2023, 9:36 AMnkshah2
09/26/2023, 10:14 AMhttp
?andrewbyrley
09/26/2023, 10:36 AMandrewbyrley
09/26/2023, 10:37 AMandrewbyrley
09/26/2023, 10:39 AMnkshah2
09/26/2023, 10:42 AMandrewbyrley
09/26/2023, 10:43 AM