Tabnine Logo For Javascript
auth
Code IndexAdd Tabnine to your IDE (free)

How to use
auth
function

Best JavaScript code snippets using auth(Showing top 15 results out of 2,457)

origin: ssbc/patchwork

// CONNECTIONS
 // refuse connections from blocked peers
 ssb.auth.hook(function (fn, args) {
  const self = this
  patchwork.contacts.isBlocking({ source: ssb.id, dest: args[0] }, function (_, blocked) {
   if (blocked) {
    args[1](new Error('Client is blocked'))
   } else {
    fn.apply(self, args)
   }
  })
 })
origin: parse-community/parse-server

triggers.maybeRunTrigger(triggers.Types.afterSave, this.auth, updatedObject, originalObject, this.config, this.context).then(result => {
  if (result && typeof result === 'object') {
   this.response.response = result;
  }
 }).catch(function (err) {
  _logger.default.warn('afterSave caught an error', err);
 })
origin: parse-community/parse-server

handleDelete(req) {
  return _rest.default.del(req.config, req.auth, this.className(req), req.params.objectId, req.info.context).then(() => {
   return {
    response: {}
   };
  });
 }
origin: avwo/whistle

function getCacheKey(options, isSocks) {
 var auth = options.auth || options.proxyAuth || '';
 var ip = (!isSocks && options.clientIp) || '';
 return [options.proxyServername ? 'https-proxy' : '', options.isHttps ? 'https' : 'http',
  options.proxyHost, options.proxyPort, auth, ip, (options.isHttps && options.cacheKey) || ''].join(':');
}
origin: keystonejs/keystone

function getPrefix(access) {
 // prettier-ignore
 let prefix = `${yesNo(access.create)}Create${yesNo(access.read)}Read${yesNo(access.update)}Update${yesNo(access.auth)}Auth`;
 if (Object.prototype.hasOwnProperty.call(access, 'delete')) {
  prefix = `${prefix}${yesNo(access.delete)}Delete`;
 }
 return prefix;
}
origin: lando/lando

// Helper to get sites for autocomplete
const getAutoCompleteSites = (answers, lando, input = null) => {
 if (!_.isEmpty(pantheonSites)) {
  return lando.Promise.resolve(pantheonSites).filter(site => _.startsWith(site.name, input));
 } else {
  const api = new PantheonApiClient(answers['pantheon-auth'], lando.log);
  return api.auth().then(() => api.getSites().map(site => ({name: site.name, value: site.name}))).then(sites => {
   pantheonSites = sites;
   return pantheonSites;
  });
 };
}
origin: atulmy/crate

const App = () => (
 <Layout>
  <Switch>
   {Object.values(routes).map((route, index) => (
    route.auth
     ? <RoutePrivate {...route} key={index} path={typeof route.path === 'function' ? route.path() : route.path}/>
     : <Route {...route} key={index} path={typeof route.path === 'function' ? route.path() : route.path}/>
   ))}

   <Route component={NotFound}/>
  </Switch>
 </Layout>
)
origin: parse-community/parse-server

// deletes all collections and drops the app from cache
function dropApp(req, res) {
 if (!req.auth.isMaster) {
  return res.status(401).send({ error: 'unauthorized' });
 }
 return req.config.database.deleteEverything().then(() => {
  AppCache.del(req.config.applicationId);
  res.status(200).send({});
 });
}
origin: strapi/strapi

async forgotPassword(ctx) {
  const input = ctx.request.body;

  try {
   await validateForgotPasswordInput(input);
  } catch (err) {
   return ctx.badRequest('ValidationError', err);
  }

  strapi.admin.services.auth.forgotPassword(input);

  ctx.status = 204;
 }
origin: keystonejs/keystone

getQueryResolvers({ schemaName }) {
  if (!this.access[schemaName].auth) return {};
  const { authenticatedQueryName } = this.gqlNames;
  return {
   [authenticatedQueryName]: (_, __, context, info) => this._authenticatedQuery(context, info),
  };
 }
origin: lando/lando

api.auth().then(() => api.getSiteEnvs(site)
 .map(env => ({name: env.id, value: env.id}))
 .filter(env => !_.includes(nopes, env.value))
 .then(envs => _.flatten([envs, [{name: 'none', value: 'none'}]])))
 .catch(err => {
  throw (_.has(err, 'response.data')) ? new Error(err.response.data) : err;
 })
origin: lando/lando

api.auth().then(() => api.getSites())
    .filter(site => site.name === options['pantheon-site'])
    .then(site => {
     options['pantheon-git-url'] = getGitUrl(site[0]);
    })
origin: parse-community/parse-server

static getJobs(req) {
  return _rest.default.find(req.config, req.auth, '_JobSchedule', {}, {}).then(scheduledJobs => {
   return {
    response: scheduledJobs.results
   };
  });
 }
origin: keystonejs/keystone

getQueries({ schemaName }) {
  if (!this.access[schemaName].auth) return [];
  const { authenticatedQueryName, outputTypeName } = this.gqlNames;
  return [`${authenticatedQueryName}: ${outputTypeName}`];
 }
origin: keystonejs/keystone

getQueries({ schemaName }) {
  if (!this.access[schemaName].auth) return [];
  const { authenticatedQueryName, outputTypeName } = this.gqlNames;
  return [`${authenticatedQueryName}: ${outputTypeName}`];
 }
auth

Popular in JavaScript

  • commander
    the complete solution for node.js command-line programs
  • bluebird
    Full featured Promises/A+ implementation with exceptionally good performance
  • js-yaml
    YAML 1.2 parser and serializer
  • superagent
    elegant & feature rich browser / node HTTP with a fluent API
  • node-fetch
    A light-weight module that brings window.fetch to node.js
  • express
    Fast, unopinionated, minimalist web framework
  • fs
  • rimraf
    A deep deletion module for node (like `rm -rf`)
  • crypto
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now