Skip to content

Commit

Permalink
Begin adding google login
Browse files Browse the repository at this point in the history
  • Loading branch information
philwing100 committed Oct 29, 2024
1 parent fade0e4 commit 11a2f4a
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions src/views/Login.vue
Original file line number Diff line number Diff line change
@@ -1,20 +1,40 @@
<template>
<div class="bruh">
<LoginComponent/>
<LoginComponent />
</div>
<h1>Sign in</h1>
<a class="button google" href="/login/federated/google">Sign in with Google</a>
</template>

<script>
import LoginComponent from '@/components/Login.vue';
//Needs to also display the sign up with google
export default {
name: 'LoginWorld',
components:{
components: {
LoginComponent
},
methods: {
async login() {
try {
const response = await axios.post('http://localhost:3000/api/signup', {
email: this.email,
password: this.password
});
this.message = 'Signup successful! Please log in.';
// Optionally, you can redirect the user to the login page
setTimeout(() => {
this.$router.push('/login');
}, 2000); // Redirect after 2 seconds
} catch (error) {
console.log(error.response.data.errors);
this.message = 'Error signing up: ' + (error.response.data.errors || error.message);
}
},
}
}
</script>


<style>
</style>
<style></style>

0 comments on commit 11a2f4a

Please sign in to comment.