How to use where clause in Knex
Create refunds with Stripe
Load HTML with Cheerio
How to send POST request with Axios
Find intersection of array in Lodash
Powered by Official white Bloop logo with a period

Terms / Privacy / Search / Support

  • Boom.unauthorized('invalid password', 'sample', { ttl: 0, cache: null, foo: 'bar' });
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">function</span> <span class="token generic-function"><span class="token function">unauthorized</span><span class="token generic class-name"><span class="token operator">&lt;</span><span class="token builtin">any</span><span class="token operator">></span></span></span><span class="token punctuation">(</span>message<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">,</span> scheme<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">,</span> attributes<span class="token operator">?</span><span class="token operator">:</span> <span class="token builtin">string</span> <span class="token operator">|</span> Boom<span class="token punctuation">.</span>unauthorized<span class="token punctuation">.</span>Attributes<span class="token punctuation">)</span><span class="token operator">:</span> Boom<span class="token punctuation">.</span><span class="token generic-function"><span class="token function">Boom</span><span class="token generic class-name"><span class="token operator">&lt;</span><span class="token builtin">any</span><span class="token operator">></span></span></span> <span class="token punctuation">(</span><span class="token operator">+</span><span class="token number">3</span> overloads<span class="token punctuation">)</span> <span class="token keyword">namespace</span> unauthorized</code><div class="typing-tooltip-markup">Returns a 401 Unauthorized error<br><br><em>@param</em> <code>message</code> — Optional message<br><br><em>@returns</em> — A 401 Unauthorized error</div></pre>
    Docs
    0
  • Boom.unauthorized('invalid password', 'sample');
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">function</span> <span class="token generic-function"><span class="token function">unauthorized</span><span class="token generic class-name"><span class="token operator">&lt;</span><span class="token builtin">any</span><span class="token operator">></span></span></span><span class="token punctuation">(</span>message<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">,</span> scheme<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">,</span> attributes<span class="token operator">?</span><span class="token operator">:</span> <span class="token builtin">string</span> <span class="token operator">|</span> Boom<span class="token punctuation">.</span>unauthorized<span class="token punctuation">.</span>Attributes<span class="token punctuation">)</span><span class="token operator">:</span> Boom<span class="token punctuation">.</span><span class="token generic-function"><span class="token function">Boom</span><span class="token generic class-name"><span class="token operator">&lt;</span><span class="token builtin">any</span><span class="token operator">></span></span></span> <span class="token punctuation">(</span><span class="token operator">+</span><span class="token number">3</span> overloads<span class="token punctuation">)</span> <span class="token keyword">namespace</span> unauthorized</code><div class="typing-tooltip-markup">Returns a 401 Unauthorized error<br><br><em>@param</em> <code>message</code> — Optional message<br><br><em>@returns</em> — A 401 Unauthorized error</div></pre>
    Docs
    0
  • Boom.unauthorized('invalid password');
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">function</span> <span class="token generic-function"><span class="token function">unauthorized</span><span class="token generic class-name"><span class="token operator">&lt;</span><span class="token builtin">any</span><span class="token operator">></span></span></span><span class="token punctuation">(</span>message<span class="token operator">?</span><span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">)</span><span class="token operator">:</span> Boom<span class="token punctuation">.</span><span class="token generic-function"><span class="token function">Boom</span><span class="token generic class-name"><span class="token operator">&lt;</span><span class="token builtin">any</span><span class="token operator">></span></span></span> <span class="token punctuation">(</span><span class="token operator">+</span><span class="token number">3</span> overloads<span class="token punctuation">)</span> <span class="token keyword">namespace</span> unauthorized</code><div class="typing-tooltip-markup">Returns a 401 Unauthorized error<br><br><em>@param</em> <code>message</code> — Optional message<br><br><em>@returns</em> — A 401 Unauthorized error</div></pre>
    Docs
    0
  • async function ({ body: { authKey } }, res, next) {
        if (!authKey) {
            next(boom.unauthorized())
        }
    
        try {
            const token = await authService.validateKey(authKey)
            response.success({}, res, token)
        } catch (error) {
            next(boom.unauthorized())
        }
    }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token punctuation">(</span>property<span class="token punctuation">)</span> Request<span class="token operator">&lt;</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token builtin">any</span><span class="token punctuation">,</span> <span class="token builtin">any</span><span class="token punctuation">,</span> QueryString<span class="token punctuation">.</span>ParsedQs<span class="token punctuation">,</span> Record<span class="token operator">&lt;</span><span class="token builtin">string</span><span class="token punctuation">,</span> <span class="token builtin">any</span><span class="token operator">>></span><span class="token punctuation">.</span>body<span class="token operator">:</span> <span class="token builtin">any</span></code></pre>
    /omarefg/product-collector mit
    0
  • Boom.unauthorized(null, 'Negotiate', 'VGhpcyBpcyBhIHRlc3QgdG9rZW4=');
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">function</span> <span class="token generic-function"><span class="token function">unauthorized</span><span class="token generic class-name"><span class="token operator">&lt;</span><span class="token builtin">any</span><span class="token operator">></span></span></span><span class="token punctuation">(</span>message<span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span> scheme<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">,</span> attributes<span class="token operator">?</span><span class="token operator">:</span> <span class="token builtin">string</span> <span class="token operator">|</span> Boom<span class="token punctuation">.</span>unauthorized<span class="token punctuation">.</span>Attributes<span class="token punctuation">)</span><span class="token operator">:</span> Boom<span class="token punctuation">.</span>Boom<span class="token operator">&lt;</span><span class="token builtin">any</span><span class="token operator">></span> <span class="token operator">&amp;</span> Boom<span class="token punctuation">.</span>unauthorized<span class="token punctuation">.</span><span class="token function">MissingAuth</span> <span class="token punctuation">(</span><span class="token operator">+</span><span class="token number">3</span> overloads<span class="token punctuation">)</span> <span class="token keyword">namespace</span> unauthorized</code><div class="typing-tooltip-markup">Returns a 401 Unauthorized error<br><br><em>@param</em> <code>message</code> — Optional message<br><br><em>@param</em> <code>scheme</code> — the authentication scheme name<br><br><em>@param</em> <code>attributes</code> — an object of values used to construct the 'WWW-Authenticate' header<br><br><em>@returns</em> — A 401 Unauthorized error</div></pre>
    Docs
    0
  • exports.register = function (server, options, next) {
      
      //...
    server.route({
        
        //...
    ,
        handler: function (request, reply) {
          if (!request.yar.get('admin')) {
            return reply(Boom.unauthorized('Unauthorized'));
          }
    
          
    
          //...
    }
      });
    
      
    
      //...
    }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">module</span> <span class="token function">register</span> <span class="token punctuation">(</span>property<span class="token punctuation">)</span> register<span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token punctuation">(</span>server<span class="token operator">:</span> <span class="token builtin">any</span><span class="token punctuation">,</span> options<span class="token operator">:</span> <span class="token builtin">any</span><span class="token punctuation">,</span> next<span class="token operator">:</span> <span class="token builtin">any</span><span class="token punctuation">)</span><span class="token operator">:</span> <span class="token builtin">any</span><span class="token punctuation">;</span> attributes<span class="token operator">:</span> <span class="token punctuation">{</span> name<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">;</span> dependencies<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token punctuation">}</span><span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre>
    /jsperf/jsperf.com mit
    0
  • module.exports = function(server, role) {
      
      //...
    function actHandlerNeedsUser(cmd, param, opts, msgDefault) {
        return function(request, reply) {
          
          //...
    if (!user) {
            if (!opts || (opts && !opts.soft)) {
              return reply(Boom.unauthorized('Not logged in'));
            }
          }
    
          
    
          //...
    };
      }
    
      
    
      //...
    }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">module</span> <span class="token keyword">export</span><span class="token operator">=</span> <span class="token punctuation">(</span>property<span class="token punctuation">)</span> <span class="token keyword">export</span><span class="token operator">=</span><span class="token operator">:</span> <span class="token punctuation">(</span><span class="token parameter">server<span class="token operator">:</span> any<span class="token punctuation">,</span> role<span class="token operator">:</span> any</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">{</span> <span class="token function-variable function">doAct</span><span class="token operator">:</span> <span class="token punctuation">(</span><span class="token parameter">request<span class="token operator">:</span> any<span class="token punctuation">,</span> reply<span class="token operator">:</span> any<span class="token punctuation">,</span> cmd<span class="token operator">:</span> any<span class="token punctuation">,</span> param<span class="token operator">:</span> any<span class="token punctuation">,</span> user<span class="token operator">:</span> any<span class="token punctuation">,</span> type<span class="token operator">:</span> any<span class="token punctuation">,</span> msgDefault<span class="token operator">:</span> any</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token keyword">void</span><span class="token punctuation">;</span> <span class="token function-variable function">actHandler</span><span class="token operator">:</span> <span class="token punctuation">(</span><span class="token parameter">cmd<span class="token operator">:</span> any<span class="token punctuation">,</span> param<span class="token operator">:</span> any<span class="token punctuation">,</span> type<span class="token operator">:</span> any<span class="token punctuation">,</span> msgDefault<span class="token operator">:</span> any</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">(</span><span class="token parameter">request<span class="token operator">:</span> any<span class="token punctuation">,</span> reply<span class="token operator">:</span> any</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token keyword">void</span><span class="token punctuation">;</span> <span class="token function-variable function">actHandlerNeedsUser</span><span class="token operator">:</span> <span class="token punctuation">(</span><span class="token parameter">cmd<span class="token operator">:</span> any<span class="token punctuation">,</span> param<span class="token operator">:</span> any<span class="token punctuation">,</span> opts<span class="token operator">:</span> any<span class="token punctuation">,</span> msgDefault<span class="token operator">:</span> any</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">(</span><span class="token parameter">request<span class="token operator">:</span> any<span class="token punctuation">,</span> reply<span class="token operator">:</span> any</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token builtin">any</span><span class="token punctuation">;</span> <span class="token function-variable function">actHandlerNeedsCdfAdmin</span><span class="token operator">:</span> <span class="token punctuation">(</span><span class="token parameter">cmd<span class="token operator">:</span> any<span class="token punctuation">,</span> param<span class="token operator">:</span> any<span class="token punctuation">,</span> msgDefault<span class="token operator">:</span> any</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">(</span><span class="token parameter">request<span class="token operator">:</span> any<span class="token punctuation">,</span> reply<span class="token operator">:</span> any</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token builtin">any</span><span class="token punctuation">;</span> <span class="token function-variable function">actHandlerNeedsDojoAdmin</span><span class="token operator">:</span> <span class="token punctuation">(</span><span class="token parameter">cmd<span class="token operator">:</span> any<span class="token punctuation">,</span> param<span class="token operator">:</span> any<span class="token punctuation">,</span> type<span class="token operator">:</span> any<span class="token punctuation">,</span> msgDefault<span class="token operator">:</span> any</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">(</span><span class="token parameter">request<span class="token operator">:</span> any<span class="token punctuation">,</span> reply<span class="token operator">:</span> any</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token builtin">any</span><span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre>
    /CoderDojo/cp-zen-platform mit
    0
  • server.route({
        method: 'GET',
        path: '/auth/twitter',
        config: {
          auth: 'twitter', // Use our twitter strategy and let bell take over
          handler: (request, reply) => {
            if (!request.auth.isAuthenticated) {
              return reply(Boom.unauthorized(`Authentication failed: ${request.auth.error.message}`));
            }
    
            const token = Jwt.sign(request.auth.credentials, Config.get('jwt.secret'));
    
            return reply.redirect('/').state(Config.get('jwt.cookie'), token);
          },
        },
      })
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token punctuation">(</span>parameter<span class="token punctuation">)</span> server<span class="token operator">:</span> <span class="token builtin">any</span></code></pre>
    /flowcommerce/redux-fetch mit
    0
  • Boom.proxyAuthRequired('auth missing');
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">function</span> <span class="token generic-function"><span class="token function">proxyAuthRequired</span><span class="token generic class-name"><span class="token operator">&lt;</span><span class="token builtin">any</span><span class="token operator">></span></span></span><span class="token punctuation">(</span>message<span class="token operator">?</span><span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">,</span> data<span class="token operator">?</span><span class="token operator">:</span> <span class="token builtin">any</span><span class="token punctuation">)</span><span class="token operator">:</span> Boom<span class="token punctuation">.</span>Boom<span class="token operator">&lt;</span><span class="token builtin">any</span><span class="token operator">></span></code><div class="typing-tooltip-markup">Returns a 407 Proxy Authentication error<br><br><em>@param</em> <code>message</code> — Optional message<br><br><em>@param</em> <code>data</code> — Optional additional error data<br><br><em>@returns</em> — A 407 Proxy Authentication error</div></pre>
    Docs
    0
  • Boom.notFound('missing');
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">function</span> <span class="token generic-function"><span class="token function">notFound</span><span class="token generic class-name"><span class="token operator">&lt;</span><span class="token builtin">any</span><span class="token operator">></span></span></span><span class="token punctuation">(</span>message<span class="token operator">?</span><span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">,</span> data<span class="token operator">?</span><span class="token operator">:</span> <span class="token builtin">any</span><span class="token punctuation">)</span><span class="token operator">:</span> Boom<span class="token punctuation">.</span>Boom<span class="token operator">&lt;</span><span class="token builtin">any</span><span class="token operator">></span></code><div class="typing-tooltip-markup">Returns a 404 Not Found error<br><br><em>@param</em> <code>message</code> — Optional message<br><br><em>@param</em> <code>data</code> — Optional additional error data<br><br><em>@returns</em> — A 404 Not Found error</div></pre>
    Docs
    0
  • Boom.serverUnavailable('unavailable');
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">function</span> <span class="token generic-function"><span class="token function">serverUnavailable</span><span class="token generic class-name"><span class="token operator">&lt;</span><span class="token builtin">any</span><span class="token operator">></span></span></span><span class="token punctuation">(</span>message<span class="token operator">?</span><span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">,</span> data<span class="token operator">?</span><span class="token operator">:</span> <span class="token builtin">any</span><span class="token punctuation">)</span><span class="token operator">:</span> Boom<span class="token punctuation">.</span>Boom<span class="token operator">&lt;</span><span class="token builtin">any</span><span class="token operator">></span></code><div class="typing-tooltip-markup">Returns a 503 Service Unavailable error<br><br><em>@param</em> <code>message</code> — Optional message<br><br><em>@param</em> <code>data</code> — Optional additional error data<br><br><em>@returns</em> — A 503 Service Unavailable error</div></pre>
    Docs
    0
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples