Fix missing redirect after login
This commit is contained in:
@ -1,11 +1,13 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gutter/flutter_gutter.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:moneymgr_mobile/providers/auth_state.dart';
|
||||
import 'package:moneymgr_mobile/routes/login/base_auth_page.dart';
|
||||
import 'package:moneymgr_mobile/services/api/api_token.dart';
|
||||
import 'package:moneymgr_mobile/providers/auth_state.dart';
|
||||
import 'package:moneymgr_mobile/services/router/routes_list.dart';
|
||||
import 'package:moneymgr_mobile/utils/extensions.dart';
|
||||
import 'package:moneymgr_mobile/widgets/app_button.dart';
|
||||
|
||||
@ -29,6 +31,11 @@ class ManualAuthScreen extends HookConsumerWidget {
|
||||
tokenValue: tokenValueController.text,
|
||||
),
|
||||
);
|
||||
|
||||
if (context.mounted) {
|
||||
if (context.canPop()) context.pop();
|
||||
context.replace(profilePage);
|
||||
}
|
||||
} catch (e, s) {
|
||||
Logger.root.severe("Failed to authenticate user! $e $s");
|
||||
if (context.mounted) {
|
||||
@ -51,8 +58,7 @@ class ManualAuthScreen extends HookConsumerWidget {
|
||||
keyboardType: TextInputType.url,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'API URL',
|
||||
helperText:
|
||||
"Format: http://moneymgr.corp.com/api",
|
||||
helperText: "Format: http://moneymgr.corp.com/api",
|
||||
),
|
||||
textInputAction: TextInputAction.next,
|
||||
),
|
||||
|
Reference in New Issue
Block a user