On session expired, Jhipster doesn't correctly manage the use case and doesn't open the login modal due to error in javascript .
Change the expiration of the token to a short delay.
You authenticate on Jhipster
You wait the delay
You open for exemple Audit in the Administration menu.
It seems that storeDestinationState method is never called onStateStorageService to set the destination.
The error in the Chrome console is :
ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'destination' of null
TypeError: Cannot read property 'destination' of null
at AuthService.authThen (auth.service.ts:25)
[email protected] C:\kids\workspace\jhipster4.3
`-- [email protected]
.yo-rc.json file generated in the root folder**
{
"generator-jhipster": {
"promptValues": {
"packageName": "com.mycompany.myapp",
"nativeLanguage": "fr"
},
"jhipsterVersion": "4.3.0",
"baseName": "jhipster",
"packageName": "com.mycompany.myapp",
"packageFolder": "com/mycompany/myapp",
"serverPort": "8080",
"authenticationType": "jwt",
"hibernateCache": "ehcache",
"clusteredHttpSession": false,
"websocket": false,
"databaseType": "sql",
"devDatabaseType": "h2Disk",
"prodDatabaseType": "postgresql",
"searchEngine": false,
"messageBroker": false,
"serviceDiscoveryType": false,
"buildTool": "maven",
"enableSocialSignIn": false,
"jwtSecretKey": "d09b10ea7671b78bf26e0be3cbfc76435a566bdb",
"clientFramework": "angular2",
"useSass": true,
"clientPackageManager": "yarn",
"applicationType": "monolith",
"testFrameworks": [],
"jhiPrefix": "jhi",
"enableTranslation": true,
"nativeLanguage": "fr",
"languages": [
"fr"
]
}
}
entityName.json files generated in the `.jhipster` directory**
ls: no such file or directory: .jhipster/*.json
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
git version 2.9.0.windows.1
node: v6.10.0
npm: 4.5.0
yeoman: 1.8.5
yarn: 0.21.3
Docker version 17.03.0-ce, build 60ccb22
docker-compose version 1.11.2, build f963d76f
Windows 7
Tested on last Chrome version
Could you put a better title?
Probably something similar to #5667, it seems we have some path in code that do not set destination.
I think it's due to the guard refactoring I did some times ago. I have to look at this tonight, if I find a fix i'll tell you
Ok so I managed to figure this out.
For me the "authorize" method in the auth service doesn't make sense as we should use guards to authorize or not a user from accessing a route.
We already do this for protected pages like admin or account, we can also do .a guard that prevent a logged user from accessing to register page.
If the JWT Token has expired we should only call logout() for me and set isAuthenticated to false.
@deepu105 are you ok with this ?
@wmarques we can add that 馃憤
@sendilkumarn Ok i'll work on this :)