Skip to content

Commit

Permalink
Fixed a authentification error
Browse files Browse the repository at this point in the history
commit 451dafe
Author: Dennis Oberhoff <[email protected]>
Date:   Sat Jan 9 12:13:03 2021 +0100

    Bump version

commit ba78fba
Author: Dennis Oberhoff <[email protected]>
Date:   Sat Jan 9 11:46:15 2021 +0100

    Fixed spotify auth error
  • Loading branch information
obrhoff committed Jan 11, 2021
1 parent 6c26ba1 commit cc98590
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 46 deletions.
18 changes: 9 additions & 9 deletions MusaicFM.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -529,12 +529,12 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 10;
CURRENT_PROJECT_VERSION = 11;
DEVELOPMENT_TEAM = YE33ZK7Z99;
INFOPLIST_FILE = MusaicFM/Info.plist;
INSTALL_PATH = "$(HOME)/Library/Screen Savers";
MACOSX_DEPLOYMENT_TARGET = 10.12;
MARKETING_VERSION = 1.2.1;
MARKETING_VERSION = 1.2.2;
PRODUCT_BUNDLE_IDENTIFIER = com.obrhoff.MusaicFM;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -548,12 +548,12 @@
CODE_SIGN_IDENTITY = "Developer ID Application: Dennis Oberhoff (YE33ZK7Z99)";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 10;
CURRENT_PROJECT_VERSION = 11;
DEVELOPMENT_TEAM = YE33ZK7Z99;
INFOPLIST_FILE = MusaicFM/Info.plist;
INSTALL_PATH = "$(HOME)/Library/Screen Savers";
MACOSX_DEPLOYMENT_TARGET = 10.12;
MARKETING_VERSION = 1.2.1;
MARKETING_VERSION = 1.2.2;
PRODUCT_BUNDLE_IDENTIFIER = com.obrhoff.MusaicFM;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -568,15 +568,15 @@
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 8;
CURRENT_PROJECT_VERSION = 9;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = MusaicFMPreferences/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.12;
MARKETING_VERSION = 1.2.1;
MARKETING_VERSION = 1.2.2;
PRODUCT_BUNDLE_IDENTIFIER = com.obrhoff.MusaicFMPreferences;
PRODUCT_NAME = "$(TARGET_NAME)";
};
Expand All @@ -590,15 +590,15 @@
CODE_SIGN_IDENTITY = "Developer ID Application";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 8;
CURRENT_PROJECT_VERSION = 9;
DEVELOPMENT_TEAM = YE33ZK7Z99;
INFOPLIST_FILE = MusaicFMPreferences/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.12;
MARKETING_VERSION = 1.2.1;
MARKETING_VERSION = 1.2.2;
PRODUCT_BUNDLE_IDENTIFIER = com.obrhoff.MusaicFMPreferences;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -643,7 +643,7 @@
repositoryURL = "https://github.com/SDWebImage/SDWebImage";
requirement = {
kind = exactVersion;
version = 5.9.4;
version = 5.10.2;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down
12 changes: 7 additions & 5 deletions MusaicFM/Manager.m
Original file line number Diff line number Diff line change
Expand Up @@ -300,15 +300,17 @@ - (void)performSpotifyTokenRequest:(NSArray*)requests

[weakSelf performRequest:recovery.copy
withCompletionHandler:^(NSDictionary* response) {
NSInteger errorCode = [response[@"error"][@"status"] integerValue];
if (response[@"error"]) {
NSError* error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSURLErrorNoPermissionsToReadFile userInfo:nil];
if (errorCode == 401) {

NSString *error = response[@"error"];
if (error) {
if ([error isEqualToString:@"invalid_grant"]) {
[weakSelf.preferences clear];
[weakSelf.preferences synchronize];

}
if (failure)
failure(error);
failure([NSError errorWithDomain:NSCocoaErrorDomain
code:NSURLErrorDataNotAllowed userInfo:nil]);
} else {
weakSelf.preferences.spotifyToken = response[@"access_token"];
[weakSelf.preferences synchronize];
Expand Down
1 change: 1 addition & 0 deletions MusaicFM/Preferences.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ - (void)encodeWithCoder:(NSCoder*)encoder

- (void)clear
{
self.artworks = nil;
self.spotifyToken = nil;
self.spotifyRefresh = nil;
self.spotifyCode = nil;
Expand Down
Loading

0 comments on commit cc98590

Please sign in to comment.