Skip to content

Commit 219c6b7

Browse files
resolve conflict
1 parent 22bae1c commit 219c6b7

File tree

4 files changed

+53
-2
lines changed

4 files changed

+53
-2
lines changed

Diff for: README.md

+39
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@ The OAuthify library provides a seamless integration for adding OAuth-based logi
88
- **Secure Authentication:** Redirects users to the respective service's login page and securely handles the OAuth callback.
99
- **Customizable:** Allows for custom handling of successful or failed logins, enabling you to tailor the user experience.
1010

11+
<<<<<<< HEAD
1112
<!-- ![OAuthify Auth 2.0 headless Component](/src/assets/OAuthify.png) -->
1213

1314
<p align="center">
1415
<img src="src/assets/OAuthify.png" alt="OAuthify Auth 2.0 headless Component" width="200">
1516
</p>
17+
=======
18+
![OAuthify Auth 2.0 headless Component](/src/assets/OAuthify.png)
19+
>>>>>>> e254e27 (updated readme)
1620
1721
### Installation
1822

@@ -45,10 +49,16 @@ import {
4549
GoogleIcon,
4650
GithubIcon,
4751
} from 'oauthify';
52+
<<<<<<< HEAD
53+
=======
54+
import { useAuth } from './contexts/Auth.context';
55+
56+
>>>>>>> e254e27 (updated readme)
4857
const googleClientId = 'xxxxxxxxx';
4958
const githubClientId = 'XXXXXXXX';
5059

5160
const App = () => {
61+
<<<<<<< HEAD
5262
const handleSuccess = (response) => {
5363
console.log('Google login success:', response);
5464
// Handle successful login, e.g., set user info in app state
@@ -59,6 +69,8 @@ const App = () => {
5969
// Handle failed login, e.g., show error message to user
6070
};
6171

72+
=======
73+
>>>>>>> e254e27 (updated readme)
6274
return (
6375
<OAuthifyProvider>
6476
<div>
@@ -70,6 +82,7 @@ const App = () => {
7082
};
7183

7284
const LoginComponent = () => {
85+
<<<<<<< HEAD
7386
return (
7487
<>
7588
<div className="flex flex-row justify-center items-center my-6 space-x-2">
@@ -79,6 +92,28 @@ const LoginComponent = () => {
7992
onSuccess={handleSuccess}
8093
onFailure={handleFailure}
8194
>
95+
=======
96+
const { onSuccess, onFailure, setOnSuccess } = useOAuthify();
97+
98+
const handleSuccess = () => {
99+
// Handle the success state of LoginWithGoogle or LoginWithGithub
100+
};
101+
const handleFailure = () => {
102+
// Handle the success state of LoginWithGoogle or LoginWithGithub
103+
};
104+
105+
React.useEffect(() => {
106+
handleSuccess();
107+
}, [onSuccess]);
108+
109+
React.useEffect(() => {
110+
handleFailure();
111+
}, [onFailure]);
112+
return (
113+
<>
114+
<div className="flex flex-row justify-center items-center my-6 space-x-2">
115+
<GoogleLoginButton clientId={googleClientId} redirectUri={redirectUri}>
116+
>>>>>>> e254e27 (updated readme)
82117
<div
83118
style={{
84119
display: 'flex',
@@ -99,12 +134,16 @@ const LoginComponent = () => {
99134
</div>{' '}
100135
</GoogleLoginButton>
101136

137+
<<<<<<< HEAD
102138
<GitHubLoginButton
103139
clientId={githubClientId}
104140
redirectUri={redirectUri}
105141
onSuccess={handleSuccess}
106142
onFailure={handleFailure}
107143
>
144+
=======
145+
<GitHubLoginButton clientId={githubClientId} redirectUri={redirectUri}>
146+
>>>>>>> e254e27 (updated readme)
108147
>
109148
<div
110149
style={{

Diff for: package-lock.json

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@
2424
],
2525
"types": "dist/types/index.d.ts",
2626
"private": false,
27+
<<<<<<< HEAD
2728
"version": "0.0.20",
29+
=======
30+
"version": "0.0.24",
31+
>>>>>>> e254e27 (updated readme)
2832
"type": "module",
2933
"files": [
3034
"dist"

Diff for: src/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
import { OAuthifyProvider } from './providers/OAuthify.provider';
55
import GitHubLoginButton from './components/SocialLogin/Github.component';
66
import GoogleLoginButton from './components/SocialLogin/Google.component';
7-
import OAuthRedirect from './app/OAuthifyRedirect/index.page';
7+
import OAuthifyRedirect from './app/OAuthifyRedirect/index.page';
88
import GoogleIcon from './components/Icons/GoogleIcon.svg';
99
import GithubIcon from './components/Icons/GithubIcon.svg';
1010
import { useOAuthify } from './providers/OAuthify.provider';
1111
export {
1212
OAuthifyProvider,
1313
GitHubLoginButton,
1414
GoogleLoginButton,
15-
OAuthRedirect,
15+
OAuthifyRedirect,
1616
GoogleIcon,
1717
GithubIcon,
1818
useOAuthify,

0 commit comments

Comments
 (0)