An Interest In:
Web News this Week
- March 20, 2024
- March 19, 2024
- March 18, 2024
- March 17, 2024
- March 16, 2024
- March 15, 2024
- March 14, 2024
React Js google auth
Install react-google-login modulenpm install react-google-login
step 2 :
Open Google developers console
Select you project -> Dashboard
select OAuth
in the left side menu
Add your add domain for react add (https://localhost:3000)
Now You can see the credentials in the dashboard
Setting Up in react
<GoogleLogin
clientId={props.authid}
onSuccess={responseGoogle}
render={(renderProps) => (
<button
onClick={renderProps.onClick}
disabled={renderProps.disabled}
class="bi bi-google btn btn-dark"
></button>
)}
theme="dark"
icon="false"
onFailure={responseGoogle}
/>
const responseGoogle = (e) => {
console.log(e.profileObj) //Data Of the User
}
Original Link: https://dev.to/abipravi/react-js-google-auth-50de
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To