File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 2727#import " MSIDWebResponseOperationFactory.h"
2828#import " MSIDConstants.h"
2929#import " MSIDFlightManager.h"
30+ #import " NSData+MSIDExtensions.h"
3031
3132@implementation MSIDSwitchBrowserResponse
3233
@@ -54,9 +55,7 @@ - (instancetype)initWithURL:(NSURL *)url
5455 NSString * browserOptionsString = self.parameters [@" browser_modes" ];
5556 if (browserOptionsString)
5657 {
57- browserOptionsString = Base64URLToStandardBase64 (browserOptionsString);
58- NSData *data = [[NSData alloc ] initWithBase64EncodedString: browserOptionsString options: 0 ];
59-
58+ NSData *data = [NSData msidDataFromBase64UrlEncodedString: browserOptionsString];
6059 uint32_t flagsValue = 0 ;
6160 [data getBytes: &flagsValue length: sizeof (flagsValue)];
6261
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ final class MSIDSwitchBrowserResponseTest: XCTestCase
8282 XCTAssertEqual ( response? . switchBrowserSessionToken, " some_code " )
8383 }
8484
85- func testInit_whenValidBrowserMode_shouldCreateObject ( ) throws
85+ func testInit_whenValidBrowserMode_hasBitmaskPrivateSessionShouldBeTrue ( ) throws
8686 {
8787 let url = URL ( string: " msauth://broker_bundle_id//switch_browser?action_uri=some_uri&code=some_code&browser_modes=AAAAAQ " ) !
8888
@@ -95,7 +95,7 @@ final class MSIDSwitchBrowserResponseTest: XCTestCase
9595 XCTAssertEqual ( response? . bitMask, 1 )
9696 }
9797
98- func testInit_whenInvalidBrowserMode_hasBitmaskShouldBeFalse ( ) throws
98+ func testInit_whenInvalidBrowserMode_hasBitmaskPrivateSessionShouldBeFalse ( ) throws
9999 {
100100 let url = URL ( string: " msauth://broker_bundle_id//switch_browser?action_uri=some_uri&code=some_code&browser_modes=AAAAAA " ) !
101101
You can’t perform that action at this time.
0 commit comments