forked from eatvio/eatvio_app
fix: reg in webview
This commit is contained in:
@@ -76,18 +76,22 @@ class _AuthScreenState extends State<AuthScreen> {
|
||||
..setNavigationDelegate(
|
||||
NavigationDelegate(
|
||||
onPageFinished: (String url) async {
|
||||
final bool tokenInStorage = await TokenStorage.haveTokenInStorage();
|
||||
final bool credentialsInStorage = await CredentialsStorage.haveCredentialsInStorage();
|
||||
|
||||
if (needLogout) {
|
||||
await logoutFromWeb();
|
||||
needLogout = false;
|
||||
} else if (!url.contains('profile') && !url.contains('registration')) {
|
||||
await _controller.runJavaScript(jsChannelAuthScript);
|
||||
} else if (url.contains('profile')) {
|
||||
await CredentialsStorage.saveCredentials(email, password);
|
||||
await loginInApplication();
|
||||
if (credentialsInStorage) {
|
||||
await CredentialsStorage.saveCredentials(email, password);
|
||||
await loginInApplication();
|
||||
} else {
|
||||
await logoutFromWeb();
|
||||
}
|
||||
} else {
|
||||
final bool tokenInStorage = await TokenStorage.haveTokenInStorage();
|
||||
final bool credentialsInStorage = await CredentialsStorage.haveCredentialsInStorage();
|
||||
|
||||
if (tokenInStorage && credentialsInStorage) {
|
||||
GoRouter.of(context).go('/my-profile-screen');
|
||||
} else if (!tokenInStorage && credentialsInStorage) {
|
||||
|
||||
Reference in New Issue
Block a user