Skip to content
This repository has been archived by the owner on Jul 31, 2019. It is now read-only.

The Authentication tutorial is missing something? #53

Closed
paulovieira opened this issue Oct 7, 2014 · 2 comments · May be fixed by AhmedAli7O1/hapijs.com#1 or doron2402/hapijs.com#12
Closed

The Authentication tutorial is missing something? #53

paulovieira opened this issue Oct 7, 2014 · 2 comments · May be fixed by AhmedAli7O1/hapijs.com#1 or doron2402/hapijs.com#12

Comments

@paulovieira
Copy link
Contributor

In the authentication tutorial (http://hapijs.com/tutorials/auth) it is said:

Next, we register the plugin, which creates a scheme with the name of basic. 
This is done within the plugin via plugin.auth.scheme().

However there is no call to plugin.auth.scheme or server.auth.scheme.

Am I missing something?

Thanks.

@gergoerdosi
Copy link
Contributor

The key word is within the plugin. So the call to plugin.auth.scheme is not in the example, but in the plugin itself. For example in hapi-auth-basic:

exports.register = function (plugin, options, next) {

    plugin.auth.scheme('cookie', internals.implementation);
    next();
};

https://github.com/hapijs/hapi-auth-cookie/blob/master/lib/index.js#L14

@paulovieira
Copy link
Contributor Author

Got it. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants