supertoken signout fix
This commit is contained in:
@@ -44,7 +44,9 @@ class _PatManAppDrawerState extends State<PatManAppDrawer> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> signOut() async {
|
Future<bool> signOut() async {
|
||||||
await SuperTokens.signOut();
|
await SuperTokens.signOut(completionHandler: (error) {
|
||||||
|
// handle error if any
|
||||||
|
});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,7 +222,10 @@ class _PatManAppDrawerState extends State<PatManAppDrawer> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
if (await signOut()) {
|
await SuperTokens.signOut(completionHandler: (error) {
|
||||||
|
print(error);
|
||||||
|
});
|
||||||
|
if (await SuperTokens.doesSessionExist() == false) {
|
||||||
Navigator.of(context).pushNamed('/');
|
Navigator.of(context).pushNamed('/');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -11,7 +11,3 @@ void main() async {
|
|||||||
);
|
);
|
||||||
runApp(const MzanziInnovationHub());
|
runApp(const MzanziInnovationHub());
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> doesSessionExist() async {
|
|
||||||
return await SuperTokens.doesSessionExist();
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ void main() async {
|
|||||||
AppEnviroment.setupEnv(Enviroment.prod);
|
AppEnviroment.setupEnv(Enviroment.prod);
|
||||||
SuperTokens.init(
|
SuperTokens.init(
|
||||||
apiDomain: AppEnviroment.baseApiUrl,
|
apiDomain: AppEnviroment.baseApiUrl,
|
||||||
apiBasePath: "/auth",
|
apiBasePath: "/api/auth",
|
||||||
);
|
);
|
||||||
runApp(const MzanziInnovationHub());
|
runApp(const MzanziInnovationHub());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user