logIn() {
   Meteor.loginWithPassword({email: this.state.email}, this.state.password, (error) => {
     if (error) {
       //return this.setState({status: 'error', message: error.reason});
     }
   });
 }
示例#2
0
 const login = () => {
   Meteor.loginWithPassword(this.state.email, this.state.password, (err) => {
     if (err) {
       this.setState({ error: err.reason, email: '', password: '' });
     } else {
       this.setState({ error: null, email: '', password: '' });
     }
   });
 };
示例#3
0
  onSignIn () {
    const { email, password } = this.state;

    if ( this.isValid() ) {
      Meteor.loginWithPassword( email, password, ( error ) => {
        if ( error ) {
          this.setState({ error: error.reason });
        }
      });
    }
  }
示例#4
0
文件: login.js 项目: andfs/zemo-react
  loginProprio() {
      let email = this.state.email;
      let senha = this.state.senha;
      if(email.length == 0) {
          this.setState({erro: "E-mail inválido."});
      }
      if(senha.length == 0) {
          this.setState({erro: "Senha inválida."}); 
      }

      let context = this;
      
      this.setState({ok: true});
      Meteor.loginWithPassword(email, senha, function(erro) {
          if(erro) {
              context.setState({erro: "Login ou senha inválidos."});
          }
          else {
            context.setState({erro: ""});
            context.storeAccessToken(Meteor.userId());
            context.setState({logado: true});
          }
      });
  }