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

310
Views
Parse User.login() no devuelve al usuario (JS SDK)

Así que estoy llamando al método Parse.User.login(). Si la combinación de nombre de usuario/contraseña no es correcta, obtengo el error correspondiente de parse. Si estoy ingresando los correctos, ocurre la anotación. ¿Alguien sabe por qué?

este es mi codigo

 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) }, }) }) }

Llamo a esta función desde un proyecto nuxt/página vue

 <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 answers
Answer question

0

prueba con:

 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 Report
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!