The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/packages/rocketchat-iframe-login/iframe_server.js

28 lines
509 B

/* globals Accounts, OAuth */
Accounts.registerLoginHandler('iframe', function(result) {
if (!result.iframe) {
return;
}
check(result.token, String);
console.log('[Method] registerLoginHandler');
const user = Meteor.users.findOne({
'services.iframe.token': result.token,
});
if (user) {
return {
userId: user._id,
};
}
});
Meteor.methods({
'OAuth.retrieveCredential'(credentialToken, credentialSecret) {
return OAuth.retrieveCredential(credentialToken, credentialSecret);
},
});