Skip to content

Commit 8ba2057

Browse files
committed
Fix some warnings
1 parent e9204fa commit 8ba2057

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

scala-oauth2-core/src/main/scala/scalaoauth2/provider/DataHandler.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,10 @@ trait DataHandler[U] {
173173
* @return true if accessToken expired
174174
*/
175175
def isAccessTokenExpired(accessToken: AccessToken): Boolean = {
176-
accessToken.expiresIn.map { expiresIn =>
176+
accessToken.expiresIn.exists { expiresIn =>
177177
val now = System.currentTimeMillis()
178178
accessToken.createdAt.getTime + expiresIn * 1000 <= now
179-
}.getOrElse(false)
179+
}
180180
}
181181

182182
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package scalaoauth2.provider
2+
3+
/**
4+
* @author dbalduini
5+
*/
6+
class ResourceServer {
7+
8+
}

scala-oauth2-core/src/main/scala/scalaoauth2/provider/TokenEndpoint.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ trait TokenEndpoint {
1515

1616
def handleRequest[U](request: AuthorizationRequest, dataHandler: DataHandler[U]): Future[Either[OAuthError, GrantHandlerResult]] = try {
1717
val grantType = request.grantType.getOrElse(throw new InvalidRequest("grant_type is not found"))
18-
val handler = handlers.get(grantType).getOrElse(throw new UnsupportedGrantType("The grant_type is not supported"))
18+
val handler = handlers.getOrElse(grantType, throw new UnsupportedGrantType("The grant_type is not supported"))
1919

2020
fetcher.fetch(request).map { clientCredential =>
2121
dataHandler.validateClient(clientCredential, grantType).flatMap { validClient =>

0 commit comments

Comments
 (0)