loginStyle with useraccounts


#1

Just wanted to share this with the community because it took me way too long to figure this out …

I have a massive blaze app that uses accounts-* and also the metor useraccounts packages (useraccounts:base, useraccounts:bootstrap)

I don’t have a dedicated mobile app yet (Cordova) so I am using the dynamic aspect of bootstrap to render the app in the mobile web browser instead.

All works well, except when I save the app to the home screen on iOS. When I try to login via facebook or google it fails, because the loginStyle = popup doesn’t work.

So I remembered that meteor_accounts_loginServiceConfiguration collection stores the loginStyle per configured authentication mechanism. So I updated the collection to use loginStyle redirect, but to my dismay it didn’t take.

Turns out that useraccounts package overwrites the loginStyle with a custom config socialLoginStyle, so changing it like so makes it work in browser and mobile

if(Meteor.isClient && window.navigator.standalone)
{
 AccountsTemplates.configure({
  socialLoginStyle: 'redirect',
 });
}

#2

I know someone who wrestled with this most of last week :slight_smile:


#3

Thanks you J ,

Well this is part of the issue as i am using 2 apps on the same Database .