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

[No QA] [TS migration] Migrate 'getPlaidOAuthReceivedRedirectURI' lib to TypeScript #26163

Merged
Show file tree
Hide file tree
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

This file was deleted.

5 changes: 5 additions & 0 deletions src/libs/getPlaidOAuthReceivedRedirectURI/index.native.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import GetPlaidOAuthReceivedRedirectURI from './types';

const getPlaidOAuthReceivedRedirectURI: GetPlaidOAuthReceivedRedirectURI = () => null;

export default getPlaidOAuthReceivedRedirectURI;
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import GetPlaidOAuthReceivedRedirectURI from './types';

/**
* After a user authenticates their bank in the Plaid OAuth flow, Plaid returns us to the redirectURI we
* gave them along with a stateID param. We hand off the receivedRedirectUri to PlaidLink to finish connecting
* the user's account.
* @returns {String | null}
*/
export default () => {
const getPlaidOAuthReceivedRedirectURI: GetPlaidOAuthReceivedRedirectURI = () => {
const receivedRedirectURI = window.location.href;
const receivedRedirectSearchParams = new URL(window.location.href).searchParams;
const oauthStateID = receivedRedirectSearchParams.get('oauth_state_id');
Expand All @@ -15,3 +16,5 @@ export default () => {
}
return receivedRedirectURI;
};

export default getPlaidOAuthReceivedRedirectURI;
3 changes: 3 additions & 0 deletions src/libs/getPlaidOAuthReceivedRedirectURI/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type GetPlaidOAuthReceivedRedirectURI = () => null | string;

export default GetPlaidOAuthReceivedRedirectURI;
Loading