Skip to content

Commit

Permalink
Merge pull request #23 from michaelburch/master
Browse files Browse the repository at this point in the history
fixes for google authentication flow
  • Loading branch information
GSingh01 authored Sep 12, 2020
2 parents 24362d1 + f8e7692 commit a7d881f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/LoginView.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default class LoginView extends PureComponent {
const result = adService.getLoginFlowResult(navState.url);
if (
result.requestType === RequestType.Ignore ||
result.requestType === RequestType.Code ||
result.requestType === RequestType.Code && !navState.loading ||
result.requestType === RequestType.PasswordReset ||
result.requestType === RequestType.Cancelled
) {
Expand Down Expand Up @@ -129,7 +129,7 @@ export default class LoginView extends PureComponent {

return (
<WebView
userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:61.0) Gecko/20100101 Firefox/61.0"
userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15"
incognito
{...rest}
originWhitelist={["*"]} // refer: https://github.com/facebook/react-native/issues/20917
Expand Down
5 changes: 5 additions & 0 deletions tests/LoginView.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ describe("LoginView", () => {
var result = instance.onShouldStartLoadWithRequest({ url: "" });
expect(result).toBe(false);
});

test("returns true", () => {
var result = instance.onShouldStartLoadWithRequest({ url: "", loading: true });
expect(result).toBe(true);
});
});

describe("RequestType.PasswordReset", () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/__snapshots__/LoginView.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ exports[`LoginView renders correctly when loaded 1`] = `
startInLoadingState={true}
tenant="TestTenant"
useSharedProcessPool={true}
userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:61.0) Gecko/20100101 Firefox/61.0"
userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15"
/>
`;

Expand Down

0 comments on commit a7d881f

Please sign in to comment.