Update the env proto and fix auth

This commit is contained in:
2024-04-29 12:42:16 +02:00
parent ad259dc553
commit ddc70e5854
7 changed files with 138 additions and 75 deletions

View File

@ -8,8 +8,9 @@ class LoginForm extends StatefulWidget {
const LoginForm({
super.key,
required this.grpcChannel,
required this.notifyParent,
});
final Function() notifyParent;
final GrpcWebClientChannel grpcChannel;
@override
State<StatefulWidget> createState() => _LoginFormState();
@ -38,6 +39,7 @@ class _LoginFormState extends State<LoginForm> {
accountsGrpc.signUp(username, email, password).then((rs) {
window.localStorage["token"] = rs.token;
window.localStorage["uuid"] = rs.uuid;
widget.notifyParent();
Navigator.of(context, rootNavigator: true).pop();
}).catchError((e) {
GrpcError error = e;
@ -66,7 +68,8 @@ class _LoginFormState extends State<LoginForm> {
accountsGrpc.signIn(username, "", password).then((rs) {
window.localStorage["token"] = rs.token;
window.localStorage["uuid"] = rs.uuid;
Navigator.of(context, rootNavigator: true).pop();
widget.notifyParent();
// Navigator.of(context, rootNavigator: true).pop();
}).catchError((e) {
print(e);
GrpcError error = e;