Skip to content

CodeCoupler Authentication Module Mockup 🔒

What is this?

This is a module that simulates an authentication module.

Setup

Install Bundle and Dependencies:

npm i vue @codecoupler/auth-bundle

Define Aliases, Externals and Assets:

{
  module: "vue",
  global: "Vue",
  entries: ["dist/vue.runtime.global.prod.js"]
},
{
  module: "@codecoupler/auth-status-vue",
  global: ["codecoupler", "auth", "statusVue"]
},
{
  module: "@codecoupler/auth-bundle",
  global: ["codecoupler", "auth", "bundle"],
  entries: ["dist/codecoupler-auth-bundle.js"]
}

Basic Usage

Configuration overview how to initialize the authentication module:

1
2
3
4
import { AuthMockup } from "@codecoupler/auth-mockup";
let auth = new AuthMockup({
    // Configuration Properties
});

All properties are optional. In fact you can initialize the module just without any arguments:

import { AuthMockup } from "@codecoupler/auth-bundle";
let auth = new AuthMockup();

Reference

Constructor Options

Use an object with the following properties:

identity: Object

Set here all or some identity properties of your dummy user. Here an example:

{ username: "admin", roles: ["example"] }

authenticated: Boolean

Set this to true if you want to be initially logedin

errorInit: Boolean | String

Set this to true or to a string (representing the error message) to throw an error on initializing

delayInit: Integer

Set here the delay before init in milliseconds

Instance Members

All standard members of an authentication module are offered.