Skip to content

Commit

Permalink
Merge branch 'refactory' of https://github.com/dukbong/spring-security
Browse files Browse the repository at this point in the history
…into refactory
  • Loading branch information
dukbong committed May 3, 2024
2 parents c25c8cc + d5f737a commit 20f49b8
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -94,14 +94,10 @@ public Mono<Void> removeAuthorizedClient(String clientRegistrationId, Authentica
// @formatter:on
}

@SuppressWarnings("unchecked")
private Map<String, OAuth2AuthorizedClient> getAuthorizedClients(WebSession session) {
Map<String, OAuth2AuthorizedClient> authorizedClients = (session != null)
? (Map<String, OAuth2AuthorizedClient>) session.getAttribute(this.sessionAttributeName) : null;
if (authorizedClients == null) {
authorizedClients = new HashMap<>();
}
return authorizedClients;
Assert.notNull(session, "session cannot be null");
Map<String, OAuth2AuthorizedClient> authorizedClients = session.getAttribute(this.sessionAttributeName);
return (authorizedClients != null) ? authorizedClients : new HashMap<>();
}

}

0 comments on commit 20f49b8

Please sign in to comment.