Skip to content
This repository has been archived by the owner on Jul 21, 2020. It is now read-only.

Commit

Permalink
Log the user out if JWT can't be renewed
Browse files Browse the repository at this point in the history
  • Loading branch information
jackcook committed Feb 22, 2017
1 parent fed1815 commit 12d9b06
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions BeamAPI.podspec
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Pod::Spec.new do |s|
s.name = "BeamAPI"
s.version = "1.4.11"
s.version = "1.4.12"
s.summary = "An interface to communicate with Beam's backend."
s.homepage = "https://github.com/WatchBeam/beam-client-swift"
s.license = "MIT"
s.author = { "Jack Cook" => "[email protected]" }

s.requires_arc = true
s.ios.deployment_target = "8.2"
s.source = { :git => "https://github.com/WatchBeam/beam-client-swift.git", :tag => "1.4.11" }
s.source = { :git => "https://github.com/WatchBeam/beam-client-swift.git", :tag => "1.4.12" }
s.source_files = "Pod/Classes/**/*"

s.dependency "Starscream", "~> 2.0"
Expand Down
4 changes: 2 additions & 2 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- BeamAPI (1.4.10):
- BeamAPI (1.4.11):
- Starscream (~> 2.0)
- SwiftyJSON (~> 3.1)
- Starscream (2.0.3)
Expand All @@ -13,7 +13,7 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
BeamAPI: 33841b5f49d372fa51e99a9b44d634d96eaa81f3
BeamAPI: aa01af335bb2892f820d4557608db13eb79aab53
Starscream: 3fdd5c277e57cca6b5c406d274e3f34a7c88f2ce
SwiftyJSON: c2842d878f95482ffceec5709abc3d05680c0220

Expand Down
8 changes: 7 additions & 1 deletion Pod/Classes/Utilities/BeamRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,13 @@ public class BeamRequest {
requestingJWT = false

guard error == nil else {
completion?(data, .invalidCredentials)
if error == .invalidCredentials {
BeamSession.logout(nil)
dataRequest(baseURL, requestType: requestType, headers: headers, params: params, body: body, options: options, completion: completion)
} else {
completion?(data, .invalidCredentials)
}

return
}

Expand Down

0 comments on commit 12d9b06

Please sign in to comment.