Skip to content
This repository was archived by the owner on Jan 9, 2021. It is now read-only.

Commit e82e8d6

Browse files
committed
fix bug where new authenticated bootstrapper format (top level bootstrap object in JSON) isn't recognized
1 parent d319f5d commit e82e8d6

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Changelog
22
=========
33

4+
### 1.0.8 (2016-08-04)
5+
6+
- Fix [Newer authenticated bootstrapper response format not handled correctly](https://github.com/gtritchie/WOPIAuth/issues/9)
7+
48
### 1.0.7 (2016-07-27)
59

610
- Fix [Token request does not include redirect_uri as per oauth2 spec](https://github.com/gtritchie/WOPIAuth/issues/8)

WOPIAuth/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>
24-
<string>7</string>
24+
<string>8</string>
2525
<key>LSApplicationCategoryType</key>
2626
<string></string>
2727
<key>LSMinimumSystemVersion</key>

WOPIAuth/ProfileResult.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ class ProfileResult {
5959
Parse JSON response from profile endpoint
6060
*/
6161
func populateFromResponseData(data: NSData) throws {
62-
let topLevelDict = try NSJSONSerialization.JSONObjectWithData(data, options: []) as! NSDictionary
62+
var topLevelDict = try NSJSONSerialization.JSONObjectWithData(data, options: []) as! NSDictionary
63+
64+
if topLevelDict["Bootstrap"] as? NSDictionary != nil {
65+
topLevelDict = topLevelDict["Bootstrap"] as! NSDictionary
66+
}
67+
6368
guard let id = topLevelDict["UserId"] as? String else {
6469
throw ProfileResult.errorWithMessage("Unable to extract userId")
6570
}

0 commit comments

Comments
 (0)