Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Fix #3334: Handle invalid VPN credentials, add 406 status code to it. (
Browse files Browse the repository at this point in the history
…#3346)

Change requested by the Guardian team.
  • Loading branch information
iccub authored Feb 24, 2021
1 parent a3e4993 commit 7e5af3b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Client/Frontend/BraveVPN/GRDAPI/GRDGatewayAPI.m
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,11 @@ - (void)registerAndCreateWithSubscriberCredential:(NSString *)subscriberCredenti
if (completion) completion(nil, NO, @"Internal server error authenticating with subscriber credential");
return;

} else if (statusCode == 410) {
NSLog(@"Subscriber credential invalid");
if (completion) completion(nil, NO, @"Subscriber credential invalid");
return;

} else if (statusCode == 410 || statusCode == 406) {
NSLog(@"Subscriber credential invalid: %@", subscriberCredential);
[GRDKeychain removeKeychanItemForAccount:kKeychainStr_SubscriberCredential];
if (completion) completion(nil, NO, @"Invalid Subscriber Credential. Please try again.");
return;
} else if (statusCode == 400) {
NSLog(@"Subscriber credential missing");
if (completion) completion(nil, NO, @"Subscriber credential missing");
Expand Down

0 comments on commit 7e5af3b

Please sign in to comment.