Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

313
Vistas
Parse User.login() is not returning the user (JS SDK)

So I am calling the Parse.User.login() method. If the username/password combination are not correct, I get the corresponding error from parse. If if I am entering the correct ones, noting happens. Does anybody knows why?

This is my code

const ParsePlattform = require('parse/node')

export function initializeParseConnection() {
  ParsePlattform.initialize(parseAppId, javaScriptKey)
  ParsePlattform.serverURL = 'http://localhost:1337/parse'

  return ParsePlattform
}

export function userLogin(username, password) {
  return new Promise(function (resolve, reject) {
    const parse = initializeParseConnection()

    parse.User.logIn(username, password, {
      success: (user) => {
        // console.log will not even be triggered
        console.log('triggered')
        resolve(user)
      },
      error: (user, error) => {
        // this gets triggered if I enter incorrect user/password combination
        console.error('Error: ' + error.code + ' ' + error.message)
        reject(error)
      },
    })
  })
}

I call this function from a nuxt project/vue page

<template>
  <main class="form-signin">
    <form>
      <div class="form-floating">
        <input
          type="text"
          v-model="username"
        />
        <label for="floatingInput">Benutzername</label>
      </div>
      <div class="form-floating">
        <input
          type="password"
          class="form-control"
          v-model="password"
        />
      </div>

   
      <button @click="login" class="w-100 btn btn-lg btn-primary">Login</button>
    </form>
  </main>
</template>

<script>
import { userLogin } from 'assets/js/parse'

export default {
  name: 'Login',
  layout: 'login',
  data() {
    return {
      password: null,
      username: null,
    }
  },
  methods: {
    async login() {
      const user = await userLogin(this.username, this.password)
    },
  },
}
</script>
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

try with:

export async function userLogin(username, password) {
    const parse = initializeParseConnection()

    try {
        const user = await parse.User.logIn(username, password)
        console.log('triggered')
        return user
    } catch (error) {
        console.error('Error: ' + error.code + ' ' + error.message)
        throw error;
    }
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda