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

Commit

Permalink
Fix Update authContext smart-on-fhir#33
Browse files Browse the repository at this point in the history
  • Loading branch information
ementele committed Jul 23, 2020
1 parent f5d2830 commit a9552f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ Contributors to the codebase, in reverse chronological order:

- Dave Carlson, @drdavec
- Pascal Pfiffner, @p2
- Eric Mentele, @EricMentele

4 changes: 3 additions & 1 deletion Sources/iOS/Auth+iOS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ extension Auth {
- parameter callback: The callback that is called when authorization completes or fails
*/
func authorize(with oauth: OAuth2, properties: SMARTAuthProperties, callback: @escaping ((OAuth2JSON?, OAuth2Error?) -> Void)) {
authContext = UIApplication.shared.keyWindow?.rootViewController

let rootViewController = UIApplication.shared.keyWindow?.rootViewController
authContext = rootViewController?.presentedViewController ?? rootViewController

oauth.authConfig.authorizeContext = authContext
oauth.authConfig.authorizeEmbedded = properties.embedded
Expand Down

0 comments on commit a9552f9

Please sign in to comment.