1.2.0 • Published 2 years ago

@moreillon/vue_authentication_wall v1.2.0

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

Vue authentication wall

This module provides the AuthenticationWall component which wraps a Vue application's content so as to prevent unauthenticated users from accessing it.

Usage

<template>
  <AuthenticationWall
    :options="options"
    @user="handle_user($event)">

    <h1>Your app</h1>
    <router-view />

  </AuthenticationWall>
</template>

<script>
import AuthenticationWall from '@moreillon/vue_authentication_wall'
export default {
  name: 'App',
  components: {
    AuthenticationWall
  },
  data: () => ({
    options: {
      login_url: 'https://api.authentication.example.com/login',
      identification_url: 'https://api.authentication.example.com/whoami',
    }
  }),
  methods: {
    handle_user(user) {
      console.log(user)
    }
  }

}
</script>

Options

Thise are the different settings that can be done via the options prop of the component

OtionDescription
login_urlURL to which the client can post credentials in order to login (required)
identification_urlURL used to retrieve one's user information
TitleThe application title if needed to be shown on the login page

Events

EventDescription
userTriggered when user information becomes available after identification using the identification_url. Returns user information if the user is authenticated.
1.2.0

2 years ago

1.1.0

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago