From b4f45cbba36d68c19fa51fc4a36d4f129b633f37 Mon Sep 17 00:00:00 2001 From: Alexander Karpov Date: Tue, 8 Aug 2017 13:27:21 +0300 Subject: [PATCH] Setting empty token as nil --- Stepic/AuthInfo.swift | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/Stepic/AuthInfo.swift b/Stepic/AuthInfo.swift index f0a50c34be..f780dbbcab 100644 --- a/Stepic/AuthInfo.swift +++ b/Stepic/AuthInfo.swift @@ -7,7 +7,6 @@ // import UIKit -import MagicalRecord class AuthInfo: NSObject { static var shared = AuthInfo() @@ -21,15 +20,6 @@ class AuthInfo: NSObject { if let id = userId { if let users = User.fetchById(id) { let c = users.count -// if c > 1 { -// print("users count > 1, deleting all") -// for user in users { -// user.MR_deleteEntity() -// } -// c = 0 -// CoreDataHelper.instance.save() -// } - if c == 0 { print("No user with such id found, downloading") ApiDataDownloader.users.retrieve(ids: [id], existing: [], refreshMode: .update, success: { @@ -86,7 +76,7 @@ class AuthInfo: NSObject { AuthInfo.shared.user = nil - self.setTokenValue(newToken) + self.setTokenValue(nil) } }) } else {