Skip to content

Commit

Permalink
feat: updated
Browse files Browse the repository at this point in the history
  • Loading branch information
abdullah4tech committed Aug 13, 2024
1 parent b6ea6d3 commit 76be6d1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/stores/authSore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const useAuthStore = defineStore('authStore', () => {
if (token) {
// Make the logout request to the backend with the token in the headers
await axios.post(
'http://localhost:5000/api/logout',
'https://backend-aurh-production.up.railway.app/api/logout',
{},
{
headers: {
Expand All @@ -68,7 +68,7 @@ const useAuthStore = defineStore('authStore', () => {

if (token) {
try {
const res = await axios.post('http://localhost:5000/api/auth', { token });
const res = await axios.post('https://backend-aurh-production.up.railway.app/api/auth', { token });
user_info.value = res.data.data as UserInfo;
return true; // User is authenticated
} catch (error) {
Expand Down
8 changes: 4 additions & 4 deletions src/views/Auth/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { Button } from '@/components/ui/button';
import { h } from 'vue';
import { ref } from 'vue';
import { RouterLink, useRouter } from 'vue-router';
import { RouterLink } from 'vue-router';
import axios from 'axios';
import { useToast } from '@/components/ui/toast/use-toast'
import { Toaster, ToastAction } from '@/components/ui/toast'
Expand Down Expand Up @@ -42,7 +42,7 @@ const errors = ref({
});
const showPassword = ref(false);
const router = useRouter();
const validateForm = () => {
let valid = true;
Expand All @@ -66,7 +66,7 @@ const validateForm = () => {
const onSubmit = async () => {
if (!validateForm()) return;
axios.post('http://localhost:5000/api/login', {
axios.post('https://backend-aurh-production.up.railway.app/api/login', {
email: form.value.email.trim(),
password: form.value.password.trim()
},
Expand All @@ -77,7 +77,7 @@ const onSubmit = async () => {
})
.then((res) => {
authStore.setAuthentication(res.data.token)
router.push('/')
location.reload();
})
.catch((err) => {
toast({
Expand Down
2 changes: 1 addition & 1 deletion src/views/Auth/SignUp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const onSubmit = async () => {
if (!validateForm()) return
loading.value = true
axios.post('http://localhost:5000/api/signup', {
axios.post('https://backend-aurh-production.up.railway.app/api/signup', {
fullname: form.value.name.trim(),
email: form.value.email.trim(),
password: form.value.password.trim()
Expand Down

0 comments on commit 76be6d1

Please sign in to comment.