Skip to content

Commit c44d73e

Browse files
committed
Merge branch 'hotfix/21.1.4'
2 parents f2c8f4c + 036a0d0 commit c44d73e

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
We follow the CalVer (https://calver.org/) versioning scheme: YY.MINOR.MICRO.
44

5+
21.1.4 (04-14-2021)
6+
===================
7+
8+
Fix personal access token revokation
9+
510
21.1.3 (04-09-2021)
611
===================
712

src/main/java/io/cos/cas/osf/model/OsfOAuth20Pat.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ public class OsfOAuth20Pat extends AbstractOsfModel {
3636
@JoinColumn(name = "owner_id")
3737
private OsfUser owner;
3838

39+
/**
40+
* Check if the personal access token has been deactivated.
41+
*
42+
* @return {@code true} or {@code false}
43+
*/
44+
public Boolean isActive() {
45+
return isActive;
46+
}
47+
3948
@Override
4049
public String toString() {
4150
return String.format("OsfOAuth20Pat [name=%s, owner=%s]", name, owner.getUsername());

src/main/java/org/apereo/cas/support/oauth/web/endpoints/OAuth20UserProfileEndpointController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ protected OAuth20AccessToken attemptToGenerateAccessTokenFromOsfPat(final String
181181

182182
// Attempt to find the OSF personal access token by the given token ID from the OSF database
183183
val osfPersonalAccessToken = getJpaOsfDao().findOnePatByTokenId(tokenId);
184-
if (osfPersonalAccessToken == null) {
184+
if (osfPersonalAccessToken == null || !osfPersonalAccessToken.isActive()) {
185185
LOGGER.warn("Cannot find OSF OAuth 2.0 PAT with id=[{}] in the OSF database", tokenId);
186186
return null;
187187
}

0 commit comments

Comments
 (0)