#oauth fix some problems ( FB still not working )

This commit is contained in:
Dominic Villemure
2024-06-10 00:11:21 -04:00
parent 2d438c30be
commit b2cbc0814d
8 changed files with 759 additions and 247 deletions

View File

@@ -15,14 +15,12 @@ export const auth = defineStore({
async login(client, email, password) {
const requestBody = {
email: email,
emailAddress: email,
password: password
};
const response = await client.post(`${baseUrl}/users/login`, requestBody)
this.user = {
accessToken: response.data.accessToken,
refreshToken: response.data.refreshToken,
email: email
accessToken: response.data,
}
localStorage.setItem('jwt', this.user.accessToken);
@@ -30,7 +28,7 @@ export const auth = defineStore({
},
async loginGoogle(client, accessToken) {
const response = await client.post(`${baseUrl}/google`, {accessToken: accessToken})
const response = await client.post(`${baseUrl}/google/sign-in`, {accessToken: accessToken})
this.user = {
accessToken: response.data.accessToken,
refreshToken: response.data.refreshToken,