forked from baron/baron-sso
Merge commit '36cef142741879e59321ec7e0ca09a6ebd9eb898'
This commit is contained in:
@@ -22,7 +22,7 @@ class _ApproveQrScreenState extends State<ApproveQrScreen> {
|
|||||||
final session = Descope.sessionManager.session;
|
final session = Descope.sessionManager.session;
|
||||||
if (session == null || session.refreshToken.isExpired) {
|
if (session == null || session.refreshToken.isExpired) {
|
||||||
setState(() => _message = "Please log in on your phone first.");
|
setState(() => _message = "Please log in on your phone first.");
|
||||||
context.go('/login'); // Redirect to login
|
context.go('/signin'); // Redirect to login
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ class _ApproveQrScreenState extends State<ApproveQrScreen> {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 16),
|
padding: const EdgeInsets.only(top: 16),
|
||||||
child: TextButton(
|
child: TextButton(
|
||||||
onPressed: () => context.go('/login'),
|
onPressed: () => context.go('/signin'),
|
||||||
child: const Text("Login on this device first"),
|
child: const Text("Login on this device first"),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ class _ResetPasswordScreenState extends State<ResetPasswordScreen> {
|
|||||||
backgroundColor: Colors.green,
|
backgroundColor: Colors.green,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
context.go('/login');
|
context.go('/signin');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
|
|||||||
@@ -257,7 +257,7 @@ class _SignupScreenState extends State<SignupScreen> {
|
|||||||
builder: (context) => AlertDialog(
|
builder: (context) => AlertDialog(
|
||||||
title: const Text('회원가입 완료'),
|
title: const Text('회원가입 완료'),
|
||||||
content: const Text('성공적으로 가입되었습니다.'),
|
content: const Text('성공적으로 가입되었습니다.'),
|
||||||
actions: [TextButton(onPressed: () => context.go('/login'), child: const Text('로그인하기'))],
|
actions: [TextButton(onPressed: () => context.go('/signin'), child: const Text('로그인하기'))],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,9 +92,9 @@ final _router = GoRouter(
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
GoRoute(
|
GoRoute(
|
||||||
path: '/login',
|
path: '/signin',
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
_routerLogger.info("Navigating to /login");
|
_routerLogger.info("Navigating to /signin");
|
||||||
return const LoginScreen();
|
return const LoginScreen();
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
@@ -159,7 +159,7 @@ final _router = GoRouter(
|
|||||||
final path = state.uri.path;
|
final path = state.uri.path;
|
||||||
|
|
||||||
// Public paths that don't require login
|
// Public paths that don't require login
|
||||||
final isPublicPath = path == '/login' ||
|
final isPublicPath = path == '/signin' ||
|
||||||
path == '/signup' ||
|
path == '/signup' ||
|
||||||
path.startsWith('/verify/') ||
|
path.startsWith('/verify/') ||
|
||||||
path == '/approve' ||
|
path == '/approve' ||
|
||||||
@@ -173,15 +173,15 @@ final _router = GoRouter(
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If not logged in and trying to access a protected page, redirect to /login
|
// If not logged in and trying to access a protected page, redirect to /signin
|
||||||
if (!isLoggedIn) {
|
if (!isLoggedIn) {
|
||||||
_routerLogger.info("Not logged in, redirecting to /login");
|
_routerLogger.info("Not logged in, redirecting to /signin");
|
||||||
return '/login';
|
return '/signin';
|
||||||
}
|
}
|
||||||
|
|
||||||
// If logged in and trying to access login page, redirect to root (dashboard)
|
// If logged in and trying to access login page, redirect to root (dashboard)
|
||||||
// This is now implicitly handled by the isPublicPath check, but kept for clarity.
|
// This is now implicitly handled by the isPublicPath check, but kept for clarity.
|
||||||
// if (isLoggedIn && path == '/login') {
|
// if (isLoggedIn && path == '/signin') {
|
||||||
// _routerLogger.info("Logged in, redirecting to /");
|
// _routerLogger.info("Logged in, redirecting to /");
|
||||||
// return '/';
|
// return '/';
|
||||||
// }
|
// }
|
||||||
|
|||||||
Reference in New Issue
Block a user