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

Commit

Permalink
fix bug where new authenticated bootstrapper format (top level bootst…
Browse files Browse the repository at this point in the history
…rap object in JSON) isn't recognized
  • Loading branch information
gtritchie committed Aug 4, 2016
1 parent d319f5d commit e82e8d6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changelog
=========

### 1.0.8 (2016-08-04)

- Fix [Newer authenticated bootstrapper response format not handled correctly](https://github.com/gtritchie/WOPIAuth/issues/9)

### 1.0.7 (2016-07-27)

- Fix [Token request does not include redirect_uri as per oauth2 spec](https://github.com/gtritchie/WOPIAuth/issues/8)
Expand Down
2 changes: 1 addition & 1 deletion WOPIAuth/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>7</string>
<string>8</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>LSMinimumSystemVersion</key>
Expand Down
7 changes: 6 additions & 1 deletion WOPIAuth/ProfileResult.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ class ProfileResult {
Parse JSON response from profile endpoint
*/
func populateFromResponseData(data: NSData) throws {
let topLevelDict = try NSJSONSerialization.JSONObjectWithData(data, options: []) as! NSDictionary
var topLevelDict = try NSJSONSerialization.JSONObjectWithData(data, options: []) as! NSDictionary

if topLevelDict["Bootstrap"] as? NSDictionary != nil {
topLevelDict = topLevelDict["Bootstrap"] as! NSDictionary
}

guard let id = topLevelDict["UserId"] as? String else {
throw ProfileResult.errorWithMessage("Unable to extract userId")
}
Expand Down

0 comments on commit e82e8d6

Please sign in to comment.