Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
use-facebook-auth
Advanced tools
Readme
A React based hook for facebook authentication.
$ npm i use-facebook-auth
or
$ yarn add use-facebook-auth
This hook uses context and hooks to provide info throughout your application on wether or not you have an active session. You'll want to wrap your app by doing the following:
import FacebookProvider from 'use-facebook-auth';
const MY_APP_ID = 'xxxxxxxx';
ReactDOM.render(
<React.StrictMode>
<FacebookProvider options={{ appId: MY_APP_ID }}>
<App />
</FacebookProvider>
</React.StrictMode>,
document.getElementById('root')
);
Your App Id is the application you're using too authentcate against. Then on any page you wish to authenticate/logout/get sessino info you can use the following hook:
import { useFacebook } from 'use-facebook-auth';
const loginOptions = {
scope: 'public_profile,email'
}
const MyMethod = () => {
const {
authenticatedSession: { // only comes back when authenticated
accessToken: 'string';
expiresIn: 'number';
signedRequest: 'string';
userID: 'string';
grantedScopes: 'string'; // optional
reauthorize_required_in: 'number'; // optional
},
authenticatedState: 'loading' | 'error' | 'authenticated' | 'unauthenticated',
isAuthenticated: true | false, //derived from the auth state;
loading: true | false, //derived from the auth state;
logout(): void,
login(loginOptions): void
} = useFacebook();
return (<div>Hello</div>);
}
The Provider requires one option, the appId, but you can also pass in language and version if you wish to alter the defaults below:
Parameter | Description |
---|---|
appId | Required The facebook app your authentication associates too. |
version | Default: v8.0 - provide a specific version |
language | Default: en_US - Provide the language you wish to see translations in |
MIT Licensed
FAQs
A React based hook for facebook authentication.
The npm package use-facebook-auth receives a total of 3 weekly downloads. As such, use-facebook-auth popularity was classified as not popular.
We found that use-facebook-auth demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.