generated from Arquisoft/wiq_0
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from Arquisoft/front-end
Some minor fixes of Login, Google Login skeleton added but implementation had to be temporally removed because of compatibility issues
- Loading branch information
Showing
8 changed files
with
725 additions
and
704 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* import GoogleLogin from "react-google-login"; | ||
import { useTranslation } from 'react-i18next'; | ||
const GClientId = "http://259836370797-brpmuu6pn6a20eecpjag1l2nkoqp3eo6.apps.googleusercontent.com"; | ||
const GLoginButton = () => { | ||
const { t } = useTranslation(); | ||
const onSuccess = (response: any) => { | ||
console.log( "LOGIN SUCCESS! Current User: ",response.profileObject); | ||
// handle successful login"" | ||
var authResponse = response.getAuthResponse(); | ||
var accessToken = authResponse.access_token; | ||
//Validations in backend should be done | ||
// Obtener el perfil del usuario | ||
var profile = accessToken.getBasicProfile(); | ||
// Obtener el email del usuario | ||
var email = profile.getEmail(); | ||
console.log(email); | ||
//send email to backend | ||
}; | ||
const onFailure = (error: any) => { | ||
console.log( "LOGIN FAILED! Error: ",error); | ||
// handle failed login | ||
}; | ||
return ( | ||
<div id='signInButton'> | ||
<GoogleLogin | ||
clientId={GClientId} | ||
buttonText={t('login_google')} | ||
onSuccess={onSuccess} | ||
onFailure={onFailure} | ||
cookiePolicy={'single_host_origin'} | ||
isSignedIn={true} | ||
/> | ||
</div> | ||
) | ||
} | ||
export default GLoginButton; */ |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
/* import { Container} from '@mui/material'; | ||
import { useTranslation } from 'react-i18next'; | ||
import GLoginButton from './GLoginButton'; | ||
type ActionProps = { | ||
goBack:()=> void; | ||
} | ||
const GoogleLogin = (props: ActionProps) => { | ||
const { t } = useTranslation(); | ||
return( | ||
<Container component="main" maxWidth="xs" sx={{ marginTop: 4 }}> | ||
<p>{t("login_google")}</p> | ||
<div> | ||
<GLoginButton/> | ||
<button color="primary" onClick={props.goBack}> | ||
{t('go_back')} | ||
</button> | ||
</div> | ||
</Container> | ||
) | ||
} | ||
export default GoogleLogin; */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters