Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

195
Views
JWT client server connection not found

error image

Server Site

Getting Email query from server site, It's not connecting to my client site But it's working on my server site

app.get('/login', async (req, res) => {
    const user = req.body;
    const accessToken = jwt.sign(user, process.env.ACCESS_TOKEN_SECRET, {
        expiresIn: '1d'
    });
    res.send({ accessToken });
});

Client Ste Login Function Part

This is my client site login part functional and callback part, There my email is showing in console but doesn't work in server which I show in picture.

import axios from 'axios';
import React from 'react';
import { useAuthState, useSignInWithEmailAndPassword } from 'react-firebase-hooks/auth';
import GoogleButton from 'react-google-button';
import { Link, useLocation, useNavigate } from 'react-router-dom';
import auth from '../Firebase.init';

const Login = () => {
    const navigate = useNavigate();

    const [signInWithEmailAndPassword, loading, error] = useSignInWithEmailAndPassword(auth);
    const [user] = useAuthState(auth);
    if (user) {
        navigate('/');
    }

    const handleLogin = async e => {
        alert('ok');

        e.preventDefault();
        const email = e.target.email.value;
        const password = e.target.password.value;
        await signInWithEmailAndPassword(email, password);
        const { data } = await axios.post('http://localhost:5000/login', { email })
        console.log(data);
        console.log(email);
    };
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!