Skip to content

Commit 76be6d1

Browse files
committed
feat: updated
1 parent b6ea6d3 commit 76be6d1

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/stores/authSore.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const useAuthStore = defineStore('authStore', () => {
4141
if (token) {
4242
// Make the logout request to the backend with the token in the headers
4343
await axios.post(
44-
'http://localhost:5000/api/logout',
44+
'https://backend-aurh-production.up.railway.app/api/logout',
4545
{},
4646
{
4747
headers: {
@@ -68,7 +68,7 @@ const useAuthStore = defineStore('authStore', () => {
6868

6969
if (token) {
7070
try {
71-
const res = await axios.post('http://localhost:5000/api/auth', { token });
71+
const res = await axios.post('https://backend-aurh-production.up.railway.app/api/auth', { token });
7272
user_info.value = res.data.data as UserInfo;
7373
return true; // User is authenticated
7474
} catch (error) {

src/views/Auth/Login.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { Button } from '@/components/ui/button';
1414
import { h } from 'vue';
1515
1616
import { ref } from 'vue';
17-
import { RouterLink, useRouter } from 'vue-router';
17+
import { RouterLink } from 'vue-router';
1818
import axios from 'axios';
1919
import { useToast } from '@/components/ui/toast/use-toast'
2020
import { Toaster, ToastAction } from '@/components/ui/toast'
@@ -42,7 +42,7 @@ const errors = ref({
4242
});
4343
4444
const showPassword = ref(false);
45-
const router = useRouter();
45+
4646
4747
const validateForm = () => {
4848
let valid = true;
@@ -66,7 +66,7 @@ const validateForm = () => {
6666
6767
const onSubmit = async () => {
6868
if (!validateForm()) return;
69-
axios.post('http://localhost:5000/api/login', {
69+
axios.post('https://backend-aurh-production.up.railway.app/api/login', {
7070
email: form.value.email.trim(),
7171
password: form.value.password.trim()
7272
},
@@ -77,7 +77,7 @@ const onSubmit = async () => {
7777
})
7878
.then((res) => {
7979
authStore.setAuthentication(res.data.token)
80-
router.push('/')
80+
location.reload();
8181
})
8282
.catch((err) => {
8383
toast({

src/views/Auth/SignUp.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ const onSubmit = async () => {
7979
if (!validateForm()) return
8080
loading.value = true
8181
82-
axios.post('http://localhost:5000/api/signup', {
82+
axios.post('https://backend-aurh-production.up.railway.app/api/signup', {
8383
fullname: form.value.name.trim(),
8484
email: form.value.email.trim(),
8585
password: form.value.password.trim()

0 commit comments

Comments
 (0)