[Solved] useraccounts + loginButtons = Broken

I’m using useraccounts:bootstrap (docs) and also trying to allow users to create an account via the built in blaze template loginButtons.

However, regardless of the fact that I have:

AccountsTemplates.configure({
    forbidClientAccountCreation: false
});

I get this:

Bummer right?

Does anyone have a simple workaround for this which brings back functionality to my blaze template?

Why do they disable this anyways, I don’t get it.

Is that block in your client-side code?

Yes it is. Should it be in the server side code?

Hm, in looking at some of my latest usage of this package, I have it on client and server. A quick check in the console is to examine AccountsTemplate.options.forbidClientAccountCreation, so you can at least understand if its a config problem or a problem with the package…

You should execute this AccountsTemplates.configure directive both on the client and the server in order for it to work.

I tried putting AccountsTemplates.configure on both client and server - this didn’t work. I ended up just creating buttons on my own instead (annoying right?)

So yeah, point blank - I don’t think that accounts-ui and useraccounts:bootstrap work together.

Only when you’ve mentioned it it occurred to me that you were using loginButtons helper from accounts-ui, but configuring useraccounts package. That of course wouldn’t work :slight_smile:. In useraccounts package you use atForm helper to render the login/signup form.

2 Likes

So, I’ve decided to just “roll my own” login buttons for now. Shame really. I wish there would be a way to use useraccounts side by side with accounts ui, but whatever. It’s not that bad to make my own buttons. I’m stuck right now on clearing the results message after a password reset, but hey - I’ll figure it out. I have a post about that too

This is the expected behaviour and there’s a reason behind it. The two packages cannot be used together.
Please see this old issue

1 Like

Yes,

So I finally figured out how to solve my problems by creating my own login buttons - it took me several days to figure out all of the workarounds. But I understand why and how this all is happening now.

@splendido is right. If you’re using the useraccounts package, you shouldn’t also be using the loginButtons from accounts-ui. There should be a way to figure out how to do everything you need to do with just useraccounts.

Thanks @splendido for replying!