@@ -8,15 +8,11 @@ The OAuthify library provides a seamless integration for adding OAuth-based logi
8
8
- ** Secure Authentication:** Redirects users to the respective service's login page and securely handles the OAuth callback.
9
9
- ** Customizable:** Allows for custom handling of successful or failed logins, enabling you to tailor the user experience.
10
10
11
- <<<<<<< HEAD
12
11
<!--  -->
13
12
14
13
<p align =" center " >
15
14
<img src =" src/assets/OAuthify.png " alt =" OAuthify Auth 2.0 headless Component " width =" 200 " >
16
15
</p >
17
- =======
18
- ![ OAuthify Auth 2.0 headless Component] ( /src/assets/OAuthify.png )
19
- >>>>>>> e254e27 (updated readme)
20
16
21
17
### Installation
22
18
@@ -49,28 +45,12 @@ import {
49
45
GoogleIcon ,
50
46
GithubIcon ,
51
47
} from ' oauthify' ;
52
- <<<<<< < HEAD
53
- ====== =
54
- import { useAuth } from ' ./contexts/Auth.context' ;
48
+ import { useOAuthify } from ' oauthify' ;
55
49
56
- >>>>>> > e254e27 (updated readme)
57
50
const googleClientId = ' xxxxxxxxx' ;
58
51
const githubClientId = ' XXXXXXXX' ;
59
52
60
53
const App = () => {
61
- <<<<<< < HEAD
62
- const handleSuccess = (response ) => {
63
- console .log (' Google login success:' , response);
64
- // Handle successful login, e.g., set user info in app state
65
- };
66
-
67
- const handleFailure = (error ) => {
68
- console .error (' Google login failure:' , error);
69
- // Handle failed login, e.g., show error message to user
70
- };
71
-
72
- ====== =
73
- >>>>>> > e254e27 (updated readme)
74
54
return (
75
55
< OAuthifyProvider>
76
56
< div>
@@ -82,17 +62,6 @@ const App = () => {
82
62
};
83
63
84
64
const LoginComponent = () => {
85
- <<<<<< < HEAD
86
- return (
87
- <>
88
- < div className= " flex flex-row justify-center items-center my-6 space-x-2" >
89
- < GoogleLoginButton
90
- clientId= {googleClientId}
91
- redirectUri= {redirectUri}
92
- onSuccess= {handleSuccess}
93
- onFailure= {handleFailure}
94
- >
95
- ====== =
96
65
const { onSuccess , onFailure , setOnSuccess } = useOAuthify ();
97
66
98
67
const handleSuccess = () => {
@@ -113,7 +82,6 @@ const LoginComponent = () => {
113
82
<>
114
83
< div className= " flex flex-row justify-center items-center my-6 space-x-2" >
115
84
< GoogleLoginButton clientId= {googleClientId} redirectUri= {redirectUri}>
116
- >>>>>> > e254e27 (updated readme)
117
85
< div
118
86
style= {{
119
87
display: ' flex' ,
@@ -134,16 +102,7 @@ const LoginComponent = () => {
134
102
< / div> {' ' }
135
103
< / GoogleLoginButton>
136
104
137
- <<<<<< < HEAD
138
- < GitHubLoginButton
139
- clientId= {githubClientId}
140
- redirectUri= {redirectUri}
141
- onSuccess= {handleSuccess}
142
- onFailure= {handleFailure}
143
- >
144
- ====== =
145
105
< GitHubLoginButton clientId= {githubClientId} redirectUri= {redirectUri}>
146
- >>>>>> > e254e27 (updated readme)
147
106
>
148
107
< div
149
108
style= {{
0 commit comments