@@ -31,7 +31,7 @@ public enum OAuth2Error: Int {
31
31
case AuthorizationError
32
32
}
33
33
34
- public typealias JSONDictionary = [ String : AnyObject ]
34
+ public typealias OAuth2JSON = [ String : AnyObject ]
35
35
36
36
37
37
/**
@@ -40,7 +40,7 @@ public typealias JSONDictionary = [String: AnyObject]
40
40
public class OAuth2
41
41
{
42
42
/** Settings, as set upon initialization. */
43
- let settings : JSONDictionary
43
+ let settings : OAuth2JSON
44
44
45
45
/** The client id. */
46
46
public let clientId : String
@@ -69,7 +69,7 @@ public class OAuth2
69
69
public var accessTokenExpiry : NSDate ?
70
70
71
71
/** Closure called on successful authentication on the main thread. */
72
- public var onAuthorize : ( ( parameters: JSONDictionary ) -> Void ) ?
72
+ public var onAuthorize : ( ( parameters: OAuth2JSON ) -> Void ) ?
73
73
74
74
/** When authorization fails (if error is not nil) or is cancelled, this block is executed on the main thread. */
75
75
public var onFailure : ( ( error: NSError ? ) -> Void ) ?
@@ -104,7 +104,7 @@ public class OAuth2
104
104
105
105
MITREid: https://github.com/mitreid-connect/
106
106
*/
107
- public init ( settings: JSONDictionary ) {
107
+ public init ( settings: OAuth2JSON ) {
108
108
self . settings = settings
109
109
110
110
if let cid = settings [ " client_id " ] as? String {
@@ -249,7 +249,7 @@ public class OAuth2
249
249
NSException ( name: " OAuth2AbstractClassUse " , reason: " Abstract class use " , userInfo: nil ) . raise ( )
250
250
}
251
251
252
- func didAuthorize( parameters: JSONDictionary ) {
252
+ func didAuthorize( parameters: OAuth2JSON ) {
253
253
callOnMainThread ( ) {
254
254
self . onAuthorize ? ( parameters: parameters)
255
255
self . afterAuthorizeOrFailure ? ( wasFailure: false , error: nil )
@@ -307,7 +307,7 @@ public class OAuth2
307
307
:returns: An NSError instance with the "best" localized error key and all parameters in the userInfo dictionary;
308
308
domain "OAuth2ErrorDomain", code 600
309
309
*/
310
- class func errorForAccessTokenErrorResponse( params: JSONDictionary ) -> NSError {
310
+ class func errorForAccessTokenErrorResponse( params: OAuth2JSON ) -> NSError {
311
311
var message = " "
312
312
313
313
// "error_description" is optional, we prefer it if it's present
0 commit comments