Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xd2sketch/react-oauth-popup
⚛️ React component for doing oAuth popups
https://github.com/xd2sketch/react-oauth-popup
nextjs oauth popup react
Last synced: about 22 hours ago
JSON representation
⚛️ React component for doing oAuth popups
- Host: GitHub
- URL: https://github.com/xd2sketch/react-oauth-popup
- Owner: XD2Sketch
- License: mit
- Created: 2018-02-24T03:57:03.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-17T10:18:26.000Z (about 2 years ago)
- Last Synced: 2025-01-16T23:02:51.701Z (8 days ago)
- Topics: nextjs, oauth, popup, react
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/react-oauth-popup
- Size: 1.28 MB
- Stars: 64
- Watchers: 4
- Forks: 25
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
## react-oauth-popup
![Node.js CI](https://github.com/kgoedecke/react-oauth-popup/workflows/Node.js%20CI/badge.svg)
OAuth-Popups are some pretty nasty jams that don't fit well in React. This component allows you declare an oauth-popup inline with your components and handles the nasty window navigation for you.
Please note: This component currently only supports OAuth Authorization Code grant type (see: [OAuth2 Grant Types](https://oauth.net/2/grant-types/) [OAuth2 Simplified](https://aaronparecki.com/oauth-2-simplified/#authorization))
### Install
NPM:
```bash
npm install react-oauth-popup --save
```Yarn:
```bash
yarn add react-oauth-popup
```### Props
* **url** - the url of the oauth navigation screen (instagram/facebook/etc.)
* **onCode** - called when the user has successfully authenticated with the oauth code
* **onClose** - called when the popup will be closed
* **width** - width of the popup window (optional)
* **height** - height of the popup window (optional)
* **title** - title of the popup window (optional)
### Example```jsx
const onCode = (code, params) => {
console.log("wooooo a code", code);
console.log("alright! the URLSearchParams interface from the popup url", params);
}
const onClose = () => console.log("closed!");function Comp() {
return (
Click me to open a Popup
);
}
```### License
MIT