MCPcopy Index your code
hub / github.com/hapijs/hapi / test

Method test

lib/auth.js:96–115  ·  view source on GitHub ↗
(name, request)

Source from the content-addressed store, hash-verified

94 }
95
96 async test(name, request) {
97
98 Hoek.assert(name, 'Missing authentication strategy name');
99 const strategy = this.#strategies[name];
100 Hoek.assert(strategy, 'Unknown authentication strategy:', name);
101
102 const bind = strategy.methods;
103 const realm = strategy.realm;
104 const response = await request._core.toolkit.execute(strategy.methods.authenticate, request, { bind, realm, auth: true });
105
106 if (!response.isAuth) {
107 throw response;
108 }
109
110 if (response.error) {
111 throw response.error;
112 }
113
114 return response.data;
115 }
116
117 async verify(request) {
118

Callers

nothing calls this directly

Calls 1

executeMethod · 0.80

Tested by

no test coverage detected