Authenticating with Meteor via DDP (and SRP?)

前端 未结 3 1443
-上瘾入骨i
-上瘾入骨i 2020-12-07 23:52

I can\'t seem to find any good information about how to authenticate a user using Meteor\'s DDP.

Is this possible? If so, what\'s the best way to do it? How can you

3条回答
  •  醉酒成梦
    2020-12-08 00:42

    A package is now doing the login part adding a loginWithPassowrd method to the DDP connection.

    meteor add ongoworks:ddp-login
    

    Then:

    // Get the connection
    var conn = DDP.connect(Meteor.absoluteUrl());
    
    // Pass the connection to `DDP.loginWithPassword`, which is otherwise similar to
    // the core `Meteor.loginWithPassword` method.
    DDP.loginWithPassword(conn, {username: 'admin'}, 'admin', function (error) { ... })
    

提交回复
热议问题