import { Injectable } from '@angular/core';
import * as Parse from "parse"

@Injectable({
  providedIn: 'root'
})
export class UserService {
  get currentUser(){
    return Parse.User.current() || {}
  }
 
  constructor() { }
  async checkUserPassword(user: {
    username: string
    password: string
  }) {
    let exists = await Parse.User.logIn(user?.username, user?.password)
    if (exists?.id) {
      return true
    }
    return false
  }
}
