Auth

The Auth plugin ensures secure and customizable authentication, making it easy for users to access the car insurance platform. It supports multiple configurations, making it adaptable to various UI layouts and user experiences.

Configure between two modes — "form" for embedding login forms within other components, and "page" for full-screen login views, set via the authMode prop.

Demo version

Plugin options Interface

interface PluginOptions {
  token?: string
  onLogin: () => void
  onTokenExpire: () => void
  selector?: string
  showWelcomePopup?: boolean
  profileManagement?: boolean
  authMode?: 'form' | 'page' // "page" by defualt
}

Example

<!DOCTYPE html>
<html lang="en">
  <head>
    <!-- load plugin style -->
    <link href="https://plugins.wedat.eu/auth/plugin.css" rel="stylesheet" />
  </head>
  <body>
    <!-- this place where plugin will render -->
    <div class="plugin"></div>

    <!-- load plugin JS synchronously -->
    <script src="https://plugins.wedat.eu/auth/plugin.js"></script>

    <!-- init plugin options on your JS file or inline JS like this -->
    <script>
      window.AUTH_API.init({
        selector: '.plugin',
        client: true,
        onLogin: () => {},
        onTokenExpire: () => {}
      })
    </script>
  </body>
</html>