-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #839 from anoopvarma-2000-p/main
fix: session time out error issue fix
- Loading branch information
Showing
4 changed files
with
18 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,20 +21,21 @@ | |
|
||
@Component | ||
public class GitHubUserAuthorizationFilter extends OncePerRequestFilter { | ||
|
||
private static final String AUTH_USER_SESSION_ATTR_NAME = "authenticatedUser"; | ||
private static final String supportEmail = "[email protected]"; | ||
private static final String supportEmailDisplayName = "Tech by Design Support <" + supportEmail + ">"; | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public record AuthenticatedUser(OAuth2User principal, GitHubUsersService.AuthorizedUser ghUser) | ||
implements Serializable { | ||
|
||
} | ||
|
||
public static final Optional<AuthenticatedUser> getAuthenticatedUser( | ||
final @NonNull HttpServletRequest request) { | ||
final var sessionUser = (AuthenticatedUser) request.getSession(true) | ||
.getAttribute(AUTH_USER_SESSION_ATTR_NAME); | ||
return Optional.ofNullable(sessionUser); | ||
return Optional.ofNullable(request.getSession(false)) | ||
.map(session -> (AuthenticatedUser) session.getAttribute(AUTH_USER_SESSION_ATTR_NAME)); | ||
} | ||
|
||
protected static final void setAuthenticatedUser(final @NonNull HttpServletRequest request, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,7 +67,7 @@ server: | |
secure: true | ||
http-only: true | ||
same-site: LAX | ||
timeout: 60m | ||
timeout: 5m | ||
|
||
org: | ||
techbd: | ||
|