Skip to content

Commit

Permalink
Get current pluto user
Browse files Browse the repository at this point in the history
  • Loading branch information
lm2343635 committed Oct 25, 2020
1 parent baa7eaf commit 2f3a917
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ PODS:
- Kingfisher (5.15.6):
- Kingfisher/Core (= 5.15.6)
- Kingfisher/Core (5.15.6)
- PlutoSDK/Core (0.8.4):
- PlutoSDK/Core (0.8.5):
- Alamofire (~> 5)
- SwiftyJSON (~> 5)
- SwiftyUserDefaults (~> 5)
- PlutoSDK/Rx (0.8.4):
- PlutoSDK/Rx (0.8.5):
- PlutoSDK/Core (~> 0)
- RxCocoa (~> 5)
- RxCocoa (5.1.1):
Expand Down Expand Up @@ -40,7 +40,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
Alamofire: 2c792affbdc2f18016e08fdbcacd60aebe1ba593
Kingfisher: b3554e7bf6106115b44e8795300bad580ef2fdc7
PlutoSDK: 4d156962bbd58309a9eb2652bb7b3368caf4e082
PlutoSDK: 294baf549a38c403a94fc17ab34b20623971166c
RxCocoa: 32065309a38d29b5b0db858819b5bf9ef038b601
RxRelay: d77f7d771495f43c556cbc43eebd1bb54d01e8e9
RxSwift: 81470a2074fa8780320ea5fe4102807cb7118178
Expand Down
7 changes: 7 additions & 0 deletions Pluto/Classes/Core/Pluto+User.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ import SwiftyJSON

extension Pluto {

public var currentUser: PlutoUser? {
guard state == .signin, let user = DefaultsManager.shared.user else {
return nil
}
return user
}

public func myInfo(isForceRefresh: Bool = false, success: @escaping (PlutoUser) -> Void, error: ErrorCompletion? = nil) {
if !isForceRefresh, let user = DefaultsManager.shared.user {
success(user)
Expand Down
2 changes: 1 addition & 1 deletion PlutoSDK.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'PlutoSDK'
s.version = '0.8.4'
s.version = '0.8.5'
s.summary = 'Swift SDK for Pluto login microservice.'

# This description is used to generate tags and improve search results.
Expand Down

0 comments on commit 2f3a917

Please sign in to comment.