I want the logged-in user of app to get logged-in into browser as well when he clicks a button on the app which will redirect him to the browser.
I have tried to use token to login but its not working though.
‘click #workout-list__web-report-link’: function (e, t) {
const webUrl = (Meteor.settings && Meteor.settings.public &&
Meteor.settings.public.webUrl);
const remoteUrl = webUrl +
/direct-access?rlt=${t.directLoginToken}&rurl=/workouts/report
;
window.open(remoteUrl, ‘_system’);
}
FlowRouter.route(’/direct-access’, {
name: ‘directAccess’,
action: function (params, queryParams) {
const redirectUrl = queryParams.rurl;
const remoteLoginToken = queryParams.rlt;
if (Meteor.user() || !remoteLoginToken) {
FlowRouter.go(redirectUrl);
return;
}
Accounts.callLoginMethod({
methodArguments: [{token: remoteLoginToken}],
userCallback: () => FlowRouter.go(redirectUrl)
});
}
});
loggedInRoute.route(’/workouts/report’, {
name: ‘workoutReport’,
action: function (params, queryParams) {
BlazeLayout.render(‘lightLayout’, {
nav: ‘workoutReportNav’,
main: ‘workoutReport’
});
}
});