New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@xanthous/auth

Package Overview
Dependencies
Maintainers
4
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xanthous/auth

## Instalation

  • 0.3.4
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
10
increased by66.67%
Maintainers
4
Weekly downloads
 
Created
Source

Auth Module

Instalation


yarn add @xanthous/auth
Backend

for dublicate default providers.js

cp node_modules/@xanthous/auth/providers.js /path/to/backend

and add this to directory into your server/model-config.json

  "_meta": {
    "sources": [
      "../node_modules/@xanthous/auth/build/models",
      "../node_modules/@xanthous/auth/node_modules/loopback-component-passport/lib/models",
    ],
    "mixins": [
    ]
  },

and add this in models

"user": {
  "dataSource": "db",
  "public": true
},
"accessToken": {
  "dataSource": "db",
  "public": false
},
"userCredential": {
  "dataSource": "db",
  "public": false
},
"userIdentity": {
  "dataSource": "db",
  "public": false
},

add this to server/server.js

const { configurator: authConfigurator } = require('@xanthous/auth');

/*
   ...
   ..
   .

   after boot script

*/
authConfigurator(app, {
  providersConfig: require('./auth-providers'),
  sessionSecret: 'XXXXX',
});

if you don't want to use default userIdentity , userCredentia and access-token


cp -r node_modules/@xanthous/auth/models/* path/to/backend/common/models/

FrontEnd

add to reducers.js


import auth from '@xanthous/auth/build/reducer'
export default combineReducers({
  auth,
  ...
  ...
});

when you wanna use the functions


import { login } from '@xanthous/auth/build/reducer'


function mapDispatchToProps(dispatch) {
  return {
    login: (credentials) => dispatch(login(credentials))
  };
}

Avaible methods.

  signup
  login
  loginWithFacebook
  loginWithGoogle
  logout

FAQs

Package last updated on 08 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc