Add register and sign up with supertokens

This commit is contained in:
2024-07-23 11:39:21 +02:00
parent b2d5369387
commit 5dd6a70329
24 changed files with 846 additions and 228 deletions

View File

@@ -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('/');
}
},
)
],