Hi all
Maybe you can point me to a fix. So, I setup a new environment, reinstalled my box modules and suddenly got the issue that my JWT Token instantly expire. After parsing the token I could see that the exp is always one hour in the past.
At first I thought my timezone setups are wrong, but now() is showing the correct timing. After digging a bit I saw that the toEpoch function in the JwtService is calculating with dateConvert( "utc2local", "1970-01-01T00:00:00Z" ). This convertion results in {ts '1970-01-01 02:00:00'} which is wrong, as the UTC offset of my region is only one hour, so it should be {ts '1970-01-01 01:00:00'}.
After digging a little bit more and check my old environment I realized I had an older cbsecurity version where the dateConvert uses January 1 1970 00:00 as date string. If I dump that the time is correctly set.
writeDump(var=dateConvert( "utc2local", "1970-01-01T00:00:00Z" ))
writeDump(var=dateConvert( "utc2local", "January 1 1970 00:00"))
---
{ts '1970-01-01 02:00:00'}
************************************************************************************
{ts '1970-01-01 01:00:00'}
************************************************************************************
For reference in the Application.cfc I just the timezone like this.timezone = "Europe/Zurich";.
As I already mentionend time itself is correct, the DB entries are showing the correct timestamp. Something with the ISO time seems to be off. Is there any setting I should set in Application.cfc or in the Commandbox Server config?
I’m using adobe@2023 engine.
Thanks for helping!