Skip to content

Commit 832e6db

Browse files
committed
Fixes refresh token
1 parent dc644ef commit 832e6db

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

AferoSwiftSDK/AFNetworking/AFNetworkingAferoAPIClient.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -334,19 +334,19 @@ extension AFNetworkingAferoAPIClient: AferoAPIClientProto {
334334
return
335335
}
336336

337-
var oAuthBaseUrl: URL?
338-
if let scheme = oAuthOpenIdURL?.scheme,let host = oAuthOpenIdURL?.host {
339-
oAuthBaseUrl = URL(string: "\(scheme)://\(host)/token");
340-
}
337+
let oAuthTokenUrl: String? = oAuthOpenIdURL != nil ? "\(oAuthOpenIdURL!.absoluteString )/token" : nil
338+
339+
DDLogInfo("RefreshUrl \(String(describing: oAuthTokenUrl))", tag: TAG)
340+
341341

342342
let oauthManager = AFOAuth2Manager(
343-
baseURL: oAuthBaseUrl ?? apiBaseURL,
343+
baseURL: apiBaseURL,
344344
clientID: oauthClientId,
345345
secret: oauthClientSecret
346346
)
347347

348348
oauthManager.authenticateUsingOAuth(
349-
withURLString: oAuthBaseUrl?.path ?? type(of: self).OAUTH_TOKEN_PATH,
349+
withURLString: oAuthTokenUrl ?? type(of: self).OAUTH_TOKEN_PATH,
350350
refreshToken: credential.refreshToken,
351351
success: {
352352
credential in

Examples/AferoLab/AferoLab/Base.lproj/Main.storyboard

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,7 @@
10631063
<navigationController title="AferoLab" automaticallyAdjustsScrollViewInsets="NO" id="YYV-1Q-Ilk" customClass="AferoLabNavigationController" customModule="AferoLab" customModuleProvider="target" sceneMemberID="viewController">
10641064
<toolbarItems/>
10651065
<navigationBar key="navigationBar" contentMode="scaleToFill" largeTitles="YES" id="NJL-Rb-4Ot">
1066-
<rect key="frame" x="0.0" y="20" width="320" height="92.5"/>
1066+
<rect key="frame" x="0.0" y="20" width="320" height="98.5"/>
10671067
<autoresizingMask key="autoresizingMask"/>
10681068
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
10691069
<color key="barTintColor" red="0.99987393619999998" green="0.67495071890000002" blue="0.24090552330000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -2904,7 +2904,7 @@
29042904
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="sf2-PJ-NAK" sceneMemberID="viewController">
29052905
<toolbarItems/>
29062906
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="qhz-SK-aoL">
2907-
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
2907+
<rect key="frame" x="0.0" y="0.0" width="320" height="50"/>
29082908
<autoresizingMask key="autoresizingMask"/>
29092909
</navigationBar>
29102910
<nil name="viewControllers"/>
@@ -3061,7 +3061,7 @@
30613061
</designables>
30623062
<inferredMetricsTieBreakers>
30633063
<segue reference="0Ax-oZ-siA"/>
3064-
<segue reference="lHG-0u-qkB"/>
3064+
<segue reference="cdP-6b-q7e"/>
30653065
<segue reference="iph-Rf-zkF"/>
30663066
</inferredMetricsTieBreakers>
30673067
<color key="tintColor" red="0.94509804249999996" green="0.59215688710000003" blue="0.21568629149999999" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>

0 commit comments

Comments
 (0)