Skip to content

Commit 98d3332

Browse files
authored
Merge pull request #605 from jembi/fix-first-route-change
Fix: Redirection to login page at the first start
2 parents 7162d50 + 3831836 commit 98d3332

File tree

5 files changed

+14
-4
lines changed

5 files changed

+14
-4
lines changed

app/config/default.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "1.16.0",
2+
"version": "1.16.1",
33
"minimumCoreVersion": "5.0.0",
44
"protocol": "https",
55
"host": "localhost",

app/scripts/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,18 @@ app.run(function ($rootScope, $location, $anchorScroll, Api) {
140140
// Retrieve the session from storage
141141
let consoleSession = localStorage.getItem('consoleSession')
142142

143+
// Initialize the route to /login if there is no consoleSession
144+
if (curRoute && !consoleSession && curRoute.indexOf('login') !== 1 && curRoute.indexOf('set-password') !== 1 && curRoute.indexOf('forgot-password') !== 1) {
145+
$location.path('/login')
146+
}
147+
143148
Api.Me.get(function (authDetails) {
144149
if (authDetails.user) {
150+
// ConsoleSession was deleted but the user still have a session
151+
if (curRoute && curRoute !== $location.path() && curRoute.indexOf('login') !== 1) {
152+
$location.path($rootScope.referringURL)
153+
}
154+
145155
consoleSession = authDetails.user
146156
// set the nav menu to show
147157
$rootScope.navMenuVisible = true

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "openhim-console",
33
"description": "This application provides a web application to configure and manage the OpenHIM-core component.",
4-
"version": "1.16.0",
4+
"version": "1.16.1",
55
"dependencies": {
66
"@types/http-server": "^0.10.1",
77
"http-server": "^0.12.3",

packaging/build-docker-centos-rpm.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
RELEASE_VERSION=$1
44
if [ -z ${RELEASE_VERSION} ]
55
then
6-
echo "You need so specify the release version you wish to build: e.g './build-docker-centos-rpm.sh 1.16.0'"
6+
echo "You need so specify the release version you wish to build: e.g './build-docker-centos-rpm.sh 1.16.1'"
77
echo "https://github.com/jembi/openhim-console/releases"
88
exit
99
fi

0 commit comments

Comments
 (0)