Migration Guide

This is a basic guide to the different configuration options and how they map between the two versions.

import { SalteAuth } from '@salte-auth/salte-auth';

const auth = new SalteAuth({
  providerUrl: 'https://salte-os.auth0.com',
  responseType: 'id_token token',
  redirectUrl: 'https://salte.io/authorize',
  clientId: 'my-client-id',
  scope: 'openid',
  routes: ['/account'],
  endpoints: [
    'https://api.google.com'
  ],
  provider: 'auth0',
  loginType: 'redirect',
  redirectLoginCallback: function(error) {
    if (error) console.error(error);
  },

  storageType: 'session',

  validation: {
    nonce: false
  },

  autoRefresh: true,
  autoRefreshBuffer: 1000,
  queryParams: {
    audience: 'my-audience'
  }
});

console.log(auth.profile.userInfo);

Last updated