Logging a user in with other than loginWithPassword

I am creating a new mobile API in 1.3 with Restivus, and I am incorporating an SMS integration, which validates the user’s phone number. So there’s no reason I need to log a user in with password? Is there another method out there?

Thanks,
Patrick

OK i figured out, first import Accounts

import {Accounts} from “meteor/accounts-base”

then you can call these method helpers, and insert a user record the normal way…

authToken = Accounts._generateStampedLoginToken()
hashedToken = Accounts._hashLoginToken authToken.token

There’s no login callback necessary for me, since it’s a server side app only for my API.

Hope this helps anybody else.

2 Likes

Adding this to be complete, it is not ?

Meteor.users.update(userId,
{$push: {‘services.resume.loginTokens’: hashStampedToken}}
);

Take a look at setUserId https://docs.meteor.com/api/methods.html