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

Latest commit

 

History

History
39 lines (27 loc) · 758 Bytes

File metadata and controls

39 lines (27 loc) · 758 Bytes
description
Logs out the currently authenticated Magic user

logout

Public Methods

Methods
logout( response: (_ resp: Response<Bool>) -> Void )
logout() -> Promise <Bool>

Returns

Promise<Bool>

Example

import MagicSDK

class MagicViewController: UIViewController {

    let magic = Magic.shared
    
    func logout() {
        guard let magic = magic else { return }
        
        // Assuming user is logged in 
        magic.user.logout(response: { response in
            guard let result = response.result 
                else { return print("Error:", response.error.debugDescription) }
            print("Result", result)
        })
    }
}