Meteor modifies smart package

How to change smart auth package?

For example, a pop-up window after registration shows that the buttons change the password and exit the system. I want to add an account edit button. How?

Thanks.

+4
source share
2 answers

To add an edit button, look here: https://github.com/meteor/meteor/tree/master/packages/accounts-ui-unstyled

In particular, the login_buttons.html file.

update: There is a note at the top of the linked file:

NOTE. You should not use these templates directly. Instead, use the global template {{loginButtons}}.

Therefore, you should find these files in your meteor installation (mine is in C:\Program Files (x86)\Meteor\packages\accounts-ui\login_buttons.html ) and edit this file.

Please note that this will change the user interface for all your meteorite accounts. If you do not want your changes to affect your other meteorite applications, you will probably have to β€œunlock” your own accounts - the ui package.

There is a discussion about how to make the user interface of your account more customizable (for example, redefined templates), but this is not possible in the current version of Meteor. I suggest describing your use case for meteor developers. Meteor developers openly welcome feedback :

Feedback please! Some specific areas of interest to us:

  • What setting do you want to do with the loginButtons template?

  • What account restrictions do you use? Everyone should have a username? Should everyone have an email?

+3
source

You can override loginButtons because the default helper object is currently public for some reason:

 Handlebars._default_helpers["loginButtons"] = function(options) { return "hello this is test"; }; 

The original helper function looks like this:

 Handlebars.registerHelper( "loginButtons", function (options) { if (options.hash.align === "right") return new Handlebars.SafeString(Template._loginButtons({align: "right"})); else return new Handlebars.SafeString(Template._loginButtons({align: "left"})); }); 

Here you can replace the default _loginButtons template with _loginButtons own.

However, this could easily break with a future version of the meteor, as Handlebars._default_helpers is not really intended to be used that way. But at least you don't need to work with a meteor plug.

You should also be sure to add your assistant after accounts-ui-unstyled . Therefore, if you use this trick in another package, be sure to declare accounts-ui-unstyled as a dependency.

0
source

Source: https://habr.com/ru/post/1441192/


All Articles