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

151
Views
La autenticación no funciona con nuxt cuando se implementa en un servidor en vivo

tengo una aplicación nuxt que usa jwt para la autenticación, en mi máquina local funciona bien, pero cuando se implementa en un servidor en vivo, la autenticación deja de funcionar,

este es mi componente de inicio de sesión:

 <script> export default { middleware: "auth", auth: "guest", layout: "none", data() { return { email: "", password: "" }; }, methods: { async onLogin() { try { this.$auth.loginWith("local", { data: { email: this.email, password: this.password } }); this.$router.push("/"); } catch (err) { console.log(err); } } } }; </script>

componente de registro

 <script> export default { middleware: "auth", auth: "guest", layout: "none", data() { return { name: "", email: "", password: "" }; }, methods: { async onSignup() { try { let data = { name: this.name, email: this.email, password: this.password }; let response = await this.$axios.$post("api/auth/signup", data); console.log(response); if (response.success) { this.$auth.loginWith("local", { data: { email: this.email, password: this.password } }); this.$router.push("/"); } } catch (err) { console.log(err); } } } };

en mi nuxt.config.js tengo:

 auth: { strategies: { local: { token: { property: "token", global: true, required: true, type: "Bearer"}, user: { property: "user", autoFetch: true }, endpoints: { login: { propertyName: "token", login: { url: "/api/auth/login", method: "post" }, }, logout: true }, user: { url: "/api/auth/user", method: "get" } } } }

respuesta que recibo cuando hago clic en el botón de inicio de sesión y registro cuando se implementa en un servidor en vivo

 Uncaught (in promise) TypeError: Cannot use 'in' operator to search for 'token' in

todo funciona bien en mi máquina local, pero cuando se implementa en vivo en firebase para alojar, la autenticación deja de funcionar

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!