 //
 
 import Foundation
-
 
 class Authorization {
     

                
                }
                
                let valid_through = requestDate.addingTimeInterval(TimeInterval.init(self.token["expires_in"] as! Int))
                
                self.token.setValue(valid_through, forKey: "valid_through") //using a Date to token validation keep it more simple
                UserDefaults.standard.setValue(self.token.value(forKey: "valid_through"), forKey: "valid_through")

                
                NotificationCenter.default.post(name:.tokenDidAuthorize, object: JSONReturn, userInfo: nil)


        getToken(with: "grant_type=authorization_code&code=\(code)&redirect_uri=\(self.redirect_uri)")
    }
    
    func getToken(with params:String) {
        
        let url = URL(string: "https://www.reddit.com/api/v1/access_token")!
        let session = URLSession.shared
