Skip to content

Commit 7075dbd

Browse files
committed
Fix empty access token response parsing
Fixes p2#247
1 parent e2d52e1 commit 7075dbd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/Base/OAuth2Base.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ open class OAuth2Base: OAuth2Securable {
313313
open func assureNoErrorInResponse(_ params: OAuth2JSON, fallback: String? = nil) throws {
314314

315315
// "error_description" is optional, we prefer it if it's present
316-
if let err_msg = params["error_description"] as? String {
316+
if let err_msg = params["error_description"] as? String, err_msg.count > 0 {
317317
throw OAuth2Error.responseError(err_msg)
318318
}
319319

0 commit comments

Comments
 (0)