Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fixes #1527

Merged
merged 2 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion http/auth.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios from 'axios';

const AUTH_HTTP_URL = 'https://zuri-auth.up.railway.app/api/v1';
export const AUTH_HTTP_URL = 'https://zuri-auth.up.railway.app/api/v1';

const $http = axios.create({
baseURL: AUTH_HTTP_URL,
Expand Down
8 changes: 4 additions & 4 deletions http/checkout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { MARKETPLACE_API_URL } from '@modules/marketplace/http';
import { CartItemProps } from '../@types';
import $http from './axios';
import axios from 'axios';
import { AUTH_HTTP_URL } from './auth';



Expand All @@ -10,7 +11,6 @@ import axios from 'axios';
export const STAGING_URL = process.env.NEXT_PUBLIC_APP_STAGING_URL || 'https://staging.zuri.team';
export const API_BASE_URL = process.env.NEXT_PUBLIC_BACKEND_ENDPOINT_URL || 'https://zuriportfolio-backend.onrender.com/api/v1'
export const RECENTLY_VIEWED_ENDPOINT = 'https://staging.zuri.team/api/marketplace/v1/recently-viewed';
export const AUTH_API_ENDPOINT = "https://zuri-auth.up.railway.app/api/auth/api"
export const CART_ENDPOINT = API_BASE_URL + "/checkout";


Expand Down Expand Up @@ -64,10 +64,10 @@ export const removeFromCart = async (productId: string, token: string) => {
throw error;
}
};
// https://zuri-auth.up.railway.app/api/auth/api/

export const createTempUser = async (datas: { email: string; firstName: string; lastName: string }) => {
try {
const apiUrl = 'https://zuri-auth.up.railway.app/api/auth/api/auth/signup-guest';
const apiUrl = `${AUTH_HTTP_URL}/auth/signup-guest`;
const response = await $http.post(apiUrl, datas);
return response.data;
} catch (error) {
Expand Down Expand Up @@ -143,7 +143,7 @@ export const makePayment = async (selectedPaymentMethod: string, token: string)

const getTokenDetails = async (token: string) => {
try {
const response = await $http.post(`${AUTH_API_ENDPOINT}/authorize`, { token });
const response = await $http.post(`${AUTH_HTTP_URL}/authorize`, { token });
return response.data;
} catch (error) {
return error;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import React from 'react';
import Image from 'next/image';
import SignUpWithSocialsButton from './SignUpWithSocialsButton';
import facebookLogo from '../../../../public/assets/images/logo/facebook-logo.svg';
import { AUTH_HTTP_URL } from '../../../../http/auth';

const SignUpWithFacebook = () => {
return (
<SignUpWithSocialsButton
onClick={function (): void {
throw new Error('Function not implemented.');
}}
href="https://zuri-auth.up.railway.app/api/auth/api/auth/facebook"
href={`${AUTH_HTTP_URL}/auth/facebook`}
leftIcon={<Image src={facebookLogo} alt="Facebook Logo" className="w-5 h-5" />}
>
Continue with Facebook
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ import React from 'react';
import Image from 'next/image';
import SignUpWithSocialsButton from './SignUpWithSocialsButton';
import githubLogo from '../../../../public/assets/images/logo/github-logo.svg';
import { AUTH_HTTP_URL } from '../../../../http/auth';
const SignUpWithGithub = () => {
return (
<SignUpWithSocialsButton
onClick={function (): void {
throw new Error('Function not implemented.');
}}
href="https://zuri-auth.up.railway.app/api/auth/api/auth/github"
href={`${AUTH_HTTP_URL}/auth/github`}
leftIcon={<Image src={githubLogo} alt="GitHub logo" className="w-5 h-5" />}
>
Continue with Github
Expand Down
6 changes: 3 additions & 3 deletions modules/auth/component/AuthSocialButtons/SignUpWithGoogle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ import Image from 'next/image';
import SignUpWithSocialsButton from './SignUpWithSocialsButton';
import googleLogo from '../../../../public/assets/Google.png';
import LogoCarousel from '@modules/home/carousel/logos/logosCarousel';
import { AUTH_HTTP_URL } from '../../../../http/auth';

const SignUpWithGoogle = () => {
const [isloading, setIsLoading] = useState(false);

const handleLinkClick = () => {
setIsLoading(true);
setTimeout(() => {
window.location.href = 'https://zuri-auth.up.railway.app/api/auth/api/auth/google';
window.location.href = `${AUTH_HTTP_URL}/auth/google`
}, 5000);
};

//href="https://zuri-auth.up.railway.app/api/auth/api/auth/google"

return (
// the google logo has white space around it, so i am reducing the margin on the right so all the buttons look similar
<SignUpWithSocialsButton
// href="https://zuri-auth.up.railway.app/api/auth/api/auth"
onClick={handleLinkClick}
isLoading={isloading}
//onClick={handleGoogleSignIn}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Input } from '@ui/Input';
import { useAuth } from '../../../../context/AuthContext';
import { notify } from '@ui/Toast';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { AUTH_HTTP_URL } from '../../../../http/auth';

interface userDetailsI {
email: string;
Expand Down Expand Up @@ -41,8 +42,8 @@ function UpdatePassword() {
const { mutate, isLoading } = useMutation(
(formData: any) => {
// This function will be called when you call the mutate function
// https://zuri-auth.up.railway.app/api/auth/api/authorize
return axios.put('https://zuri-auth.up.railway.app/api/auth/api/auth/reset-password/change', formData);

return axios.put(`${AUTH_HTTP_URL}/auth/reset-password/change`, formData);
},
{
// onSuccess callback is triggered when the mutation is successful
Expand Down