iOS Authentication

iOS Mobile framework provides class CRPTSignManager which is used for injecting authorize tokens inside the framework. Use unique instance “shared“ and method “SignIn”:

CRPTSignManager.shared.signIn(number: String, access: AccessToken, completion: (Error?) -> Void)

The framework provides CRPTProfileManager for observe authorize states and logout users in the framework.

CRPTProfileManager.shared.logout() 
CRPTProfileManager.shared.observe(closure: (State) → Void)

Structures:

struct AccessToken: Codable {
    var accessToken: String?
    var expiresIn: Int?
    var refreshToken: String?
    var scope: String?
    var tokenType: String?
}

enum State {
    case unauthorized //unauthorized 
    case pinVerification //unauthorized
    case authorized //authorized
}