-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from transferwise/DEVEX-45_oauth-connect-popup
OAuth connect in popup window sample
- Loading branch information
Showing
20 changed files
with
1,214 additions
and
6 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @transferwise/wp-devex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export type SelectedProfile = { | ||
id: string | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
**/.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# local env files | ||
.env*.local | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# OAuth Connect Popup Sample | ||
|
||
In our regular authorization flow your application redirects the customer to the Wise authorization page. With some additional steps it can be implemented inside a popup window, meaning that the user does not leave your app. | ||
|
||
On a high level you'll only need to do two changes: | ||
- open the Wise authorization page in a popup window instead of a full redirect | ||
- build a mechanism that understands when the flow is complete | ||
|
||
See sequence diagram below for more details. | ||
|
||
More info about [Authentication and access](https://docs.wise.com/api-docs/features/authentication-access) and [Authorization flow in a Popup Window](https://docs.wise.com/api-docs/guides/oauth-popup). | ||
|
||
## Key elements | ||
|
||
We're using [Next.js](https://nextjs.org/), because it allows us to show server and client side code in a single app. | ||
|
||
Start off by exploring `/pages/index.tsx`. | ||
|
||
## Running it locally | ||
|
||
Prerequisite: make sure you have [Node.js](https://nodejs.org/en) installed. | ||
- `npm install` (installs all the packages) | ||
- `npm run dev` (starts the app at http://localhost:3000/) | ||
|
||
## Recording | ||
|
||
https://github.com/transferwise/wise-platform-samples/assets/39053304/b9b8c4a8-7e42-4b4b-99b0-204ebfe91ec2 | ||
|
||
## Sequence diagram | ||
|
||
![oauth-consent-popup](https://github.com/transferwise/wise-platform-samples/assets/39053304/ffee4fd7-7d1b-46a4-97ea-b67fcaf54b94) | ||
|
||
For more details have a look at our [Authorization flow in a Popup Window](https://docs.wise.com/api-docs/guides/oauth-popup) guide. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
reactStrictMode: true, | ||
transpilePackages: ['common'], | ||
} | ||
|
||
module.exports = nextConfig |
Oops, something went wrong.