Giter Club home page Giter Club logo

meteor-login-components's Introduction

#fongandrew:login-components Standalone login / sign-up Blaze templates that are easier to compose than accounts-ui-unstyled.

Installation

meteor add fongandrew:login-components

Usage

Just add {{> loginOrSignUp}} to a template you want to use for a simple password-based authentication.

The LoginComponents object contains config options.

Replace these callbacks with functions of your choice to customize behavior after logging in, signing up, or signing out:

LoginComponents.loginCallback = function() { ... };
LoginComponents.signupCallback = function() { ... };
LoginComponents.logoutCallback = function(error) { ... };

By default, the loginCallback and the signupCallback do not trigger if there is a server eror during login or signup. The error is instead handled by template code. You can set LoginComponents.callbackOnErr to true if you. wish the callback to be called with the error (the Blaze template will still do its own error handling independent of what you do in your callback).

NB: This library also supports using LoginComponents.signinCallback and LoginComponents.signoutCallback for backwards-compatability reasons, but the is to eventually deprecate those callbacks.

By default, the template uses a tab bar at the top to switch between login and signup modes. You can turn this off with LoginComponents.showTabs = false. If showTabs is false, we'll display links at the bottom of the login or signup page (like accounts-ui-unstyled does).

You can also change which mode is displayed reactively by calling LoginComponents.mode.set(mode), where mode is 'login', 'forgot-pw', or 'sign-up'.

meteor-login-components's People

Contributors

fongandrew avatar

Stargazers

Fabio Dias Rollo avatar

Watchers

 avatar James Cloos avatar  avatar

meteor-login-components's Issues

Trouble with loginCallback

Hey there. thanks for making this!

I'm having some trouble with callback functions. I've added this to my app:

LoginComponents = {
  loginCallback: function() {
    console.log('loginCallback worked');
  }
};

But can't get it to fire after logging in. I'm not sure where I'm going wrong. Any direction you could give here would be awesome! thank you.

P.S. I might have missed something, but should this line in signout_button.js reference signoutCallback instead?

Meteor.logout(LoginComponents.signoutCallback);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.