Accounts-ui styling


#1

Hey!

I’m using the accounts-ui package and displaying {{> loginButtons}}. This looks good and works nicely when the user is logged in. However, i would like to have a large landing page if the user is not logged in. (Example, facebook).

How do i accomplish this? If i override the css, it looks different all over the site. So how do i have 2 different styles for it? Can i somehow get whats behind {{> loginButtons}} and only change the classes, myself?

Thanks in advance

  • Glutch

#2

check out useraccounts package


#3

Specifically: https://github.com/meteor-useraccounts/core/blob/master/Guide.md#content-protection


#4

Thank you.

I added it and styled it as i like.

But is this “synced” with accounts-password and my already existing user thing?

Also, i cant seem to be able to change from Email to usernames, as i was using earlier.

Do you know anything about this?


#5

Also my old login system is broken, i cant register or signup. Sweeeet!

EDIT: i removed eveything with useraccounts:bootstrap and it now works again with my old accounts-password package. not sure what to do now…


#6

Woops, my apologies there. I was simply refering you to a relevant section of the documentation and not suggesting you go ahead with anything.

accounts-ui ties into accounts-password etc so it should all be linked.

If you’ve gone ahead and configured your router there may be a routing problem.

What happens when you try to register?


#7

I added useraccounts:bootstrap, added the {{> forms}}

and stuff didnt work, i couldnt register, but i could login to old accounts (through my old regular accounts-password)

I cant remember what the error was, since ive removed everything. What is the proper way to inlclude this? ^^


#8

The Quickstart guide should provide enough insight to get it working.

Its not a good idea to delete everything when something breaks :(.


#9

The css is saved, so i just gotta implement it again, the right way. Whatever that is :smile:


#10

The username problem is fixed! (Kinda)

var pwd = AccountsTemplates.removeField('password');
AccountsTemplates.removeField('email');
AccountsTemplates.addFields([
  {
      _id: "username",
      type: "text",
      displayName: "username",
      required: true,
      minLength: 5,
  },
  {
      _id: 'email',
      type: 'email',
      required: false,
      displayName: "email",
      placeholder: "Email (optional)",
      re: /.+@(.+){2,}\.(.+){2,}/,
      errStr: 'Invalid email',
  },
  pwd
]);

I cant seem to change the required state to false.
The placeholder modification takes place and works as intended. But the package doesnt care if i change “required” to false. I cant still register without email :frowning:

Doest work if i set it to false, doesnt work if i remove it. It is always required.