Add register and sign up with supertokens
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/main.dart';
|
||||
import 'package:supertokens_flutter/supertokens.dart';
|
||||
|
||||
class HomeAppDrawer extends StatefulWidget {
|
||||
final String userEmail;
|
||||
@@ -17,6 +18,11 @@ class _HomeAppDrawerState extends State<HomeAppDrawer> {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
Future<bool> signOut() async {
|
||||
await SuperTokens.signOut();
|
||||
return true;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
//print(MzanziInnovationHub.of(context)?.theme.mode);
|
||||
@@ -55,9 +61,11 @@ class _HomeAppDrawerState extends State<HomeAppDrawer> {
|
||||
),
|
||||
],
|
||||
),
|
||||
onTap: () {
|
||||
client.auth.signOut();
|
||||
Navigator.of(context).pushNamed('/');
|
||||
onTap: () async {
|
||||
//client.auth.signOut();
|
||||
if (await signOut()) {
|
||||
Navigator.of(context).pushNamed('/');
|
||||
}
|
||||
},
|
||||
)
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user