adding redirection if user already has a staff
This commit is contained in:
@@ -108,12 +108,19 @@ class _PhoneVerificationPageState extends State<PhoneVerificationPage> {
|
|||||||
state.mode == AuthMode.signup) {
|
state.mode == AuthMode.signup) {
|
||||||
final String message = state.errorMessage ?? '';
|
final String message = state.errorMessage ?? '';
|
||||||
if (message.contains('staff profile')) {
|
if (message.contains('staff profile')) {
|
||||||
Modular.to.pushReplacementNamed(
|
final ScaffoldMessengerState messenger =
|
||||||
'./phone-verification',
|
ScaffoldMessenger.of(context);
|
||||||
arguments: <String, String>{
|
messenger.hideCurrentSnackBar();
|
||||||
'mode': AuthMode.login.name,
|
messenger.showSnackBar(
|
||||||
},
|
SnackBar(
|
||||||
|
content: Text(message),
|
||||||
|
duration: const Duration(seconds: 5),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
Future<void>.delayed(const Duration(seconds: 5), () {
|
||||||
|
if (!mounted) return;
|
||||||
|
Modular.to.navigate('/');
|
||||||
|
});
|
||||||
} else if (message.contains('not authorized')) {
|
} else if (message.contains('not authorized')) {
|
||||||
Modular.to.pop();
|
Modular.to.pop();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user