问题
As i have read rocket chat documentation for i frame automatically login i follow these steps
- Go to Adminstration > Accounts > Iframe and enable it.
- Hit rest api and got userId and authToken . But from where i got iframe code and how can i integrate it with application
Meteor.loginWithToken('3wzsXzG53AN5qU_byQVZZNt79oh5wviOMpwB2IHOyHR', callback); I got this error : Uncaught ReferenceError: Meteor is not defined
And where i used rocket server url . Please help me how can i login in rocket chat automatically when login in our application using iframe
回答1:
Use IframeId with meteor call as below
document.getElementById(iframeId).Meteor.loginWithToken('3wzsXzG53AN5qU_byQVZZNt79oh5wviOMpwB2IHOyHR');
来源:https://stackoverflow.com/questions/48095976/how-to-add-iframe-of-rocket-chat-in-website