npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

relution-client-security

v1.1.0

Published

A Login/Logout Module for Relution LiveData. Works well with generator-m

Downloads

5

Readme

###Relution Client Security Bower version Build Status NPM

A Login/Logout Module for Relution LiveData. Works well with generator-m Installation

bower install --save relution-client-security

###Docs

Scripts

<script src="bower_components/relution-client-login/dist/relution-client-security.js"></script>
<script src="bower_components/relution-client-login/dist/templates.js"></script>

Inject

angular.module('relutionApp', [
  'relutionClientSecurity'
])

Configuration

#####Forms Available Layout Styles (based on Ionic Framework):

$relutionSecurityConfigProvider.setLayoutStyle();

example:

$relutionSecurityConfigProvider.setLayoutStyle('INPUT_ICONS');

#####Icons default icons check ionic Icons

  android: {
    login: 'ion-log-in',
    username: 'ion-android-person',
    password: 'ion-lock-combination',
    organization: 'ion-briefcase',
    logout: 'ion-log-out'
  },
  ios: {
    login: 'ion-log-in',
    username: 'ion-ios-person',
    password: 'ion-lock-combination',
    organization: 'ion-briefcase',
    logout: 'ion-log-out'
  }

example

$relutionSecurityConfigProvider.setIcons();
//or
$relutionSecurityConfigProvider.setIcons('android', {
	login: 'my custom icon' ...
});
$relutionSecurityConfigProvider.setIcons('ios', {
	login: 'my custom icon' ...
});

#####Redirect after add your $state

After Login redirect:

$relutionSecurityConfigProvider.forwardStateAfterLogin = 'tab.messenger';

After Logout redirect:

$relutionSecurityConfigProvider.forwardStateAfterLogout = 'auth.login';

#####Server Urls Login

$relutionSecurityConfigProvider.loginUrl = 'http://coredev.mwaysolutions.com/rest/....';

Logout

$relutionSecurityConfigProvider.logoutUrl = 'http://coredev.mwaysolutions.com/rest/....';

Full example

angular.module('app', [])
.config(function ($relutionSecurityConfigProvider) {
    //$relutionSecurityConfigProvider.setLayoutStyle('STACKED_LABELS');
    //$relutionSecurityConfigProvider.setLayoutStyle('PLACEHOLDER_LABELS');
    //$relutionSecurityConfigProvider.setLayoutStyle('INLINE_LABELS');
    //$relutionSecurityConfigProvider.setLayoutStyle('FLOATING_LABELS');
    //$relutionSecurityConfigProvider.setLayoutStyle('INSET_LABELS');
    $relutionSecurityConfigProvider.setLayoutStyle('INPUT_ICONS');
    $relutionSecurityConfigProvider.setIcons();
    $relutionSecurityConfigProvider.forwardStateAfterLogin = 'tab.messenger';
    $relutionSecurityConfigProvider.forwardStateAfterLogout = 'auth.login';
    $relutionSecurityConfigProvider.loginUrl = 'myloginOnServer';
    $relutionSecurityConfigProvider.logoutUrl = 'mylogoutOnServer';

#Login #####Controller Please notice you have to use your Controller in 'as' mode and name it 'loginC' example:

ng-controller="LoginCtrl as loginC"

or in $stateProvider :

angular.module('auth', ['relutionClientSecurity'])
  .config(function ($stateProvider) {
    debugger;
    $stateProvider
      .state('auth', {
        url: '/auth',
        abstract: true,
        template: '<ion-nav-view name="auth"></ion-nav-view>'
      })
      .state('auth.login', {
        parent: 'auth',
        url: '/login',
        views: {
          'auth': {
            templateUrl: 'auth/templates/login/index.html',
            controller: 'LoginCtrl as loginC'
          }
        }
      });
  });

full controller

'use strict';
/**
 * @ngdoc controller
 * @name auth:LoginCtrl
 * @requires $scope
 * @description add your description
 */
angular.module('auth')
  .controller('LoginCtrl', function LoginCtrl($scope, $state, $filter, LoginService, AlertService, $relutionSecurityConfig) {
    var self = this;
    this.service = LoginService;
    
    //error handling form not valid
    this.getMessage = function (errors) {
      var message = 'Please check following Fields: ';
      angular.forEach(errors, function (error) {
        message += error.$name + ' ';
      });
      return message;
    };
    
    //submit form you get the form
    this.submit = function (loginform) {
      if (loginform.$valid) {
        this.service.logon();
      } else {
        //form not valid
        alert(self.getMessage(loginform.$error.required));
      }
    };
    
    //set view set icons
    $scope.$on('$ionicView.afterEnter', function () {
      self.icons = $relutionSecurityConfig.iconSet;
      self.include = $relutionSecurityConfig.view;
    });
  });

View

<div ng-if="!loginC.service.isLoggedIn" ng-include="loginC.include"></div>

ion view example:

<ion-view hide-nav-bar="true">
  <ion-content>
    <div ng-if="!loginC.service.isLoggedIn" ng-include="loginC.include"></div>
    <ion-list ng-if="loginC.service.isLoggedIn">
      <ion-item class="item-text-wrap">
        <p>You are already Logged in!</p>
      </ion-item>
      <ion-item ui-sref="tab.movies">
        Movies
      </ion-item>
      <ion-item ui-sref="tab.messenger">
        Chat
      </ion-item>
    </ion-list>
  </ion-content>
</ion-view>

#Logout Directive

<relution-log-out-button></relution-log-out-button>

navbar example:

<ion-nav-bar class="bar-dark">
  <ion-nav-back-button>
  </ion-nav-back-button>
  <ion-nav-buttons side="secondary">
    <relution-log-out-button></relution-log-out-button>
  </ion-nav-buttons>
</ion-nav-bar>

###User Information The user service will be filled in after succesfully login available methods. Check the documentation.

###Header Information the HeaderService will be filled in after succesfully Login available Variables are - HeaderService.XGoferUser - HeaderService.XServer - HeaderService.XRelutionVersion

###Available Translation Keys

{{Username}}
{{Password}}
{{Login}}