Search code examples
meteorpassword-protection

Meteor Password Protect complete Application


Can I "Password-Protect" my whole Meteor Application something like "htaccess" in PHP?

For example: I don't want the public to have access to my site, but the client wants to see it.


Solution

  • Didn´t recognize that this is the answer. First Google hit. https://github.com/Jabbslad/basic-auth

    EDIT:

    In fact very Simple.

    Add the package.

    meteor add jabbslad:basic-auth
    

    add this code in serverside code

    var basicAuth = new HttpBasicAuth("guest", "password");
    basicAuth.protect();
    

    There are some more options you can see in the repository readme.md