supertoken signout fix

This commit is contained in:
2024-07-23 17:14:59 +02:00
parent 3679611f45
commit 3d97772600
3 changed files with 8 additions and 7 deletions

View File

@@ -44,7 +44,9 @@ class _PatManAppDrawerState extends State<PatManAppDrawer> {
}
Future<bool> signOut() async {
await SuperTokens.signOut();
await SuperTokens.signOut(completionHandler: (error) {
// handle error if any
});
return true;
}
@@ -220,7 +222,10 @@ class _PatManAppDrawerState extends State<PatManAppDrawer> {
],
),
onTap: () async {
if (await signOut()) {
await SuperTokens.signOut(completionHandler: (error) {
print(error);
});
if (await SuperTokens.doesSessionExist() == false) {
Navigator.of(context).pushNamed('/');
}
},