Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

oauthify

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oauthify - npm Package Compare versions

Comparing version 0.0.23 to 0.0.24

2

package.json

@@ -27,3 +27,3 @@ {

"private": false,
"version": "0.0.23",
"version": "0.0.24",
"type": "module",

@@ -30,0 +30,0 @@ "files": [

@@ -44,2 +44,4 @@ ### OAuthify

} from 'oauthify';
import { useAuth } from './contexts/Auth.context';
const googleClientId = 'xxxxxxxxx';

@@ -49,12 +51,2 @@ const githubClientId = 'XXXXXXXX';

const App = () => {
const handleSuccess = (response) => {
console.log('Google login success:', response);
// Handle successful login, e.g., set user info in app state
};
const handleFailure = (error) => {
console.error('Google login failure:', error);
// Handle failed login, e.g., show error message to user
};
return (

@@ -71,11 +63,22 @@ <OAuthifyProvider>

const LoginComponent = () => {
const { onSuccess, onFailure, setOnSuccess } = useOAuthify();
const handleSuccess = () => {
// Handle the success state of LoginWithGoogle or LoginWithGithub
};
const handleFailure = () => {
// Handle the success state of LoginWithGoogle or LoginWithGithub
};
React.useEffect(() => {
handleSuccess();
}, [onSuccess]);
React.useEffect(() => {
handleFailure();
}, [onFailure]);
return (
<>
<div className="flex flex-row justify-center items-center my-6 space-x-2">
<GoogleLoginButton
clientId={googleClientId}
redirectUri={redirectUri}
onSuccess={handleSuccess}
onFailure={handleFailure}
>
<GoogleLoginButton clientId={googleClientId} redirectUri={redirectUri}>
<div

@@ -101,8 +104,3 @@ style={{

<GitHubLoginButton
clientId={githubClientId}
redirectUri={redirectUri}
onSuccess={handleSuccess}
onFailure={handleFailure}
>
<GitHubLoginButton clientId={githubClientId} redirectUri={redirectUri}>
>

@@ -109,0 +107,0 @@ <div

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc