Changeset 4d97b63 for jobvista-frontend/src/views/auth
- Timestamp:
- 08/30/24 15:44:27 (3 months ago)
- Branches:
- main
- Parents:
- 0f0add0
- Location:
- jobvista-frontend/src/views/auth
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
jobvista-frontend/src/views/auth/SignInForm.js
r0f0add0 r4d97b63 1 import {Button, TextField} from "@mui/material";2 1 import {Link} from "react-router-dom"; 3 2 import "./auth.css" … … 9 8 import {AuthActions} from "../../redux/actions/authActions"; 10 9 import {notifyIncorrectEmailOrPassword} from "../../utils/toastUtils"; 10 11 import {GoogleOAuthProvider, GoogleLogin} from "@react-oauth/google"; 11 12 12 13 export const SignInForm = () => { … … 40 41 } 41 42 43 const handleGoogleSuccess = (response) => { 44 const tokenId = response.credential; 45 46 dispatch(AuthActions.signInGoogle(tokenId, (success, error) => { 47 if (success) { 48 console.log("User signed in successfully"); 49 if(success) { 50 navigate("/") 51 } 52 } else { 53 console.error("Google sign-in failed", error); 54 } 55 })); 56 }; 57 58 const handleGoogleFailure = (error) => { 59 console.error(error); 60 }; 61 42 62 return ( 43 63 44 <div className=" d-flex align-items-center">64 <div className=""> 45 65 <div className="container"> 46 <div className="row ">47 <div className="col-md-8 mx-autoform-container">66 <div className="row d-flex flex-column justify-content-center align-items-center"> 67 <div className="col-md-8 form-container"> 48 68 <h3 className="login-heading mb-4">Sign in</h3> 49 69 <form onSubmit={handleSubmit(signIn)}> … … 83 103 84 104 <div className="row"> 105 <GoogleOAuthProvider clientId={process.env.REACT_APP_GOOGLE_CLIENT_ID}> 106 <GoogleLogin 107 onSuccess={handleGoogleSuccess} 108 onError={handleGoogleFailure} 109 type={"standard"} 110 text={"signin_with"} 111 locale={"en"} 112 redirectUri="http://localhost:3000/login/oauth2/code/google" 113 /> 114 </GoogleOAuthProvider> 115 </div> 116 <br/> 117 </div> 118 119 <div className="col-md-8 mt-5 form-container"> 120 <div> 121 <h5 className="mb-3">Don't have an account?</h5> 122 </div> 123 124 <div className="row"> 85 125 <div className="col-md-6"> 86 126 <Link to="/signup/recruiter" className="btn auth-secondary-btn text-uppercase fw-bold mb-2 w-100">SIGN UP AS RECRUITER</Link> … … 91 131 </div> 92 132 </div> 133 93 134 </div> 94 135 </div> -
jobvista-frontend/src/views/auth/auth.css
r0f0add0 r4d97b63 4 4 } 5 5 6 .form-container {7 margin-bottom: 80px;8 }9 6 10 7 .auth-primary-btn{ … … 27 24 color: white; 28 25 } 26 27 iframe{ 28 margin: auto !important; 29 }
Note:
See TracChangeset
for help on using the changeset viewer.