Update the env proto and fix auth
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user