Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for bad token refreshes #77

Merged
merged 1 commit into from
Aug 8, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions Stepic/AuthInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

import UIKit
import MagicalRecord

class AuthInfo: NSObject {
static var shared = AuthInfo()
Expand All @@ -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: {
Expand Down Expand Up @@ -86,7 +76,7 @@ class AuthInfo: NSObject {

AuthInfo.shared.user = nil

self.setTokenValue(newToken)
self.setTokenValue(nil)
}
})
} else {
Expand Down