Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Googlesign #657

Merged
merged 4 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/Components/Login/Login.css
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,9 @@ p a:hover {
.eye:hover {
color: #007efc;
cursor: pointer;
}
}
.google-login-wrapper {
width: 100%;
display: flex;
justify-content: center;
}
2 changes: 2 additions & 0 deletions src/Components/Login/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const Login = ({ isDarkMode }) => {
<div className={`login-container ${isDarkMode ? 'dark-mode' : ''}`}>
<h2>Login</h2>
<div className="input-container">
<label>Email</label>
<input
type="email"
placeholder="Email"
Expand All @@ -84,6 +85,7 @@ const Login = ({ isDarkMode }) => {
{warnings.email && <p style={{ color: "red" }} className="warningmsg">{warnings.email}</p>}

<div className="input-container">
<label>Password</label>
<input
type={isVisible ? "text" : "password"}
placeholder="Password"
Expand Down
10 changes: 9 additions & 1 deletion src/Components/Signup/Signup.css
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,12 @@ input.valid {
input.invalid {
border-color: red;
/* Red border for invalid inputs */
}
}


/* style for google login button */
.google-login-wrapper {
width: 100%;
display: flex;
justify-content: center;
}
22 changes: 13 additions & 9 deletions src/Components/Signup/Signup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,19 @@ const Signup = () => {
<p>
Already have an account? <NavLink to="/login">Login</NavLink>
</p>
<GoogleLogin
onSuccess={(credentialResponse) => {
const credentialDecoded = jwtDecode(credentialResponse.credential);
console.log(credentialDecoded);
}}
onError={() => {
console.log("Sign-Up Failed");
}}
/>
<div className="google-login-wrapper">
<GoogleLogin
onSuccess={(credentialResponse) => {
const credentialDecoded = jwtDecode(credentialResponse.credential);
console.log(credentialDecoded);
}}
onError={() => {
console.log("Sign-Up Failed!");
}}
/>
</div>


</div>
</div>
);
Expand Down