Skip to content

Commit 824baa2

Browse files
Merge pull request #20 from Bahmni-Covid19/327-redirect-on-login
327 | Resolves redirection issue after login
2 parents 31af760 + b9d11f0 commit 824baa2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/in/org/projecteka/hiu/user/JWTGenerator.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import java.time.LocalDateTime;
1414
import java.time.ZoneId;
15+
import java.time.ZonedDateTime;
1516
import java.time.temporal.ChronoUnit;
1617

1718
import static in.org.projecteka.hiu.common.Constants.IST;
@@ -28,7 +29,7 @@ public String tokenFrom(User user) {
2829
.claim("username", user.getUsername())
2930
.claim("role", user.getRole())
3031
.claim("isVerified", user.isVerified())
31-
.claim("exp", LocalDateTime.now().plus(1, ChronoUnit.HOURS).atZone(ZoneId.of(IST)).toInstant().toEpochMilli())
32+
.claim("exp", ZonedDateTime.of(LocalDateTime.now(ZoneId.of(IST)), ZoneId.systemDefault()).plus(1, ChronoUnit.HOURS).toInstant().toEpochMilli())
3233
.build();
3334
JWSObject jwsObject = new JWSObject(new JWSHeader(JWSAlgorithm.HS256), new Payload(claims.toJSONObject()));
3435
jwsObject.sign(signer);

0 commit comments

Comments
 (0)