Skip to content

Commit e570a0e

Browse files
committed
fix(router): fix redirection logic
- Fixed auth redirection
1 parent e6c49ee commit e570a0e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/router/router.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ final appRouter = GoRouter(
1515
const authenticationPath = Routes.authentication;
1616
const headlinesFeedPath = Routes.headlinesFeed;
1717

18-
// If the user is not authenticated, redirect to the headlines feed
18+
// If the user is authenticated, redirect to the headlines feed
1919
// unless they are already on a route within the headlines feed.
20-
if (appStatus != AppStatus.authenticated) {
20+
if (appStatus == AppStatus.authenticated) {
2121
if (!state.matchedLocation.startsWith(headlinesFeedPath)) {
2222
return headlinesFeedPath;
2323
}
2424
}
25-
// If the user is authenticated, redirect to the authentication page
25+
// If the user is not authenticated, redirect to the authentication page
2626
// unless they are already on a route within the authentication section.
2727
else {
2828
if (!state.matchedLocation.startsWith(authenticationPath)) {

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: ht_main
22
description: main headlines toolkit mobile app.
3-
version: 0.30.0
3+
version: 0.30.1
44
publish_to: none
55
repository: https://github.com/headlines-toolkit/ht-main
66
environment:

0 commit comments

Comments
 (0)