Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

http module, authentication, authorization and session management

License

Notifications You must be signed in to change notification settings

moshensky/aurelia-auth-session

Repository files navigation

aurelia-auth-session

This plugin is for the Aurelia platform. It sets up authentication, authorization and user session.

How to install this plugin?

  1. In your project install the plugin via jspm with following command
jspm install bootstrap
jspm install font-awesome
jspm install github:CodeSeven/toastr
jspm install service=github:moshensky/aurelia-auth-session
  1. Include css files somewhere (for example app.html)
<template>
    <require from="bootstrap/css/bootstrap.css"></require>
    <require from="font-awesome/css/font-awesome.css"></require>
    <require from="service/loading-mask/loading-mask.css"></require>
    <require from="CodeSeven/toastr/build/toastr.min.css"></require>

    <require from="nav-bar"></require>

    <nav-bar router.bind="router"></nav-bar>
    <div style="background: white;" class="page-host">
      <router-view></router-view>
    </div>
</template>
  1. Add plugin configuration in main.js
export function configure(aurelia) {
  aurelia.use
    .plugin('service', (config) => {
      config.useLocale('bg-BG');
      config.setHttpService({
        authHost: 'http://localhost:9000',
        serviceHost: 'http://localhost:9000',
        serviceApiPrefix: '/',
        requestTimeout: 30000, // milliseconds
        hosts: {
          "hostName": 'host address'
        }
      });
      config.routerAuthStep({
        loginRoute: 'login'
      });
    });

  aurelia.start().then(a => a.setRoot());
}

About

http module, authentication, authorization and session management

Resources

License

Stars

Watchers

Forks

Packages

No packages published