All Projects → nabiltntn → Loggedin Mixin

nabiltntn / Loggedin Mixin

A simple logged-in and roles check minxin to use with mdg:validated-method package

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Loggedin Mixin

Sentinel
A framework agnostic authentication & authorization system.
Stars: ✭ 1,354 (+6670%)
Mutual labels:  authentication, roles
Authentication Server
A simple authentication service to deliver JWT with Hasura claims, based on users with multiples roles stored in a Postgres database.
Stars: ✭ 48 (+140%)
Mutual labels:  authentication, roles
Laravel Auth
Laravel 8 with user authentication, registration with email confirmation, social media authentication, password recovery, and captcha protection. Uses offical [Bootstrap 4](http://getbootstrap.com). This also makes full use of Controllers for the routes, templates for the views, and makes use of middleware for routing. The project can be stood u…
Stars: ✭ 2,692 (+13360%)
Mutual labels:  authentication, roles
Brandenburg
Laravel Authentication Package
Stars: ✭ 79 (+295%)
Mutual labels:  authentication, roles
Laravel Auth
A powerful authentication, authorization and verification package built on top of Laravel. It provides developers with Role Based Access Control, Two-Factor Authentication, Social Authentication, and much more, compatible Laravel’s standard API and fully featured out of the box.
Stars: ✭ 128 (+540%)
Mutual labels:  authentication, roles
Security.identity
.NET DevPack Identity is a set of common implementations to help you implementing Identity, Jwt, claims validation and another facilities
Stars: ✭ 165 (+725%)
Mutual labels:  authentication, roles
Shinobi
👺 Simple and light-weight role-based permissions system for Laravel's built in Auth system.
Stars: ✭ 349 (+1645%)
Mutual labels:  authentication, roles
Halite
High-level cryptography interface powered by libsodium
Stars: ✭ 933 (+4565%)
Mutual labels:  authentication
Php Casbin
An authorization library that supports access control models like ACL, RBAC, ABAC in PHP .
Stars: ✭ 865 (+4225%)
Mutual labels:  roles
Fernet Java8
Java 8 implementation of the Fernet Specification
Stars: ✭ 24 (+20%)
Mutual labels:  authentication
Kratos Selfservice Ui React Native
A reference implementation of an app using ORY Kratos for auth (login), sign up (registration), profile settings (update password), MFA/2FA, account recovery (password reset), and more for React Native. This repository is available as an expo template!
Stars: ✭ 24 (+20%)
Mutual labels:  authentication
Aspnetcore.authentication.apitoken
A asp.net core webapi token authentication & generator open source library.
Stars: ✭ 26 (+30%)
Mutual labels:  authentication
Typescript Seed
Typescript Seed Project (Angular, Hapi, Cookie Auth, TypeORM, Postgres)
Stars: ✭ 12 (-40%)
Mutual labels:  authentication
Joomla External Login
The External Login project allows Joomla! to manage external Authentication Servers
Stars: ✭ 24 (+20%)
Mutual labels:  authentication
Nebular
💥 Customizable Angular UI Library based on Eva Design System 🌚✨Dark Mode
Stars: ✭ 7,368 (+36740%)
Mutual labels:  authentication
Mean Angular5 Passport Authentication
Securing MEAN Stack (Angular 5) Web Application using Passport Authentication
Stars: ✭ 24 (+20%)
Mutual labels:  authentication
Guardian auth
The Guardian Authentication Implementation Using Ecto/Postgresql Elixir Phoenix [ User Authentication ]
Stars: ✭ 15 (-25%)
Mutual labels:  authentication
Deepstream.io
deepstream.io server
Stars: ✭ 6,947 (+34635%)
Mutual labels:  authentication
Servicestack.java
ServiceStack Java Libraries and Apps
Stars: ✭ 10 (-50%)
Mutual labels:  authentication
Rbac
Hierarchical Role Based Access Control for NodeJS
Stars: ✭ 857 (+4185%)
Mutual labels:  authentication

loggedin-mixin

Install

$ meteor add tunifight:loggedin-mixin

Usage

// Method definition
const method = new ValidatedMethod({
  name, // DDP method name
  mixins : [LoggedInMixin],
  checkLoggedInError: {
    error: 'notLogged',
    message: 'You need to be logged in to call this method',//Optional
    reason: 'You need to login' //Optional
  },
  validate, // argument validation
  run // Method body
});

The LoggedInMixin mixin requires the new checkLoggedInError option which includes the required informations to throw an Error. Note that message and reason are optional.

Roles check

If you are using alanning:roles package in your application, you can add roles check to the basic logged-in check.

For that, you need to add the new checkRoles option which includes the required informations about roles, group and the error to throw.

// Method definition
const method = new ValidatedMethod({
  name, // DDP method name
  mixins : [LoggedInMixin],
  checkRoles: {
    roles: ['admin'],
    group: 'group1', // Optional
    rolesError: {
      error: 'not-allowed',
      message: 'You are not allowed to call this method',//Optional
      reason: 'You are not allowed to call this method' //Optional
    }
  }
  checkLoggedInError: {
    error: 'notLogged',
    message: 'You need to be logged in to call this method',//Optional
    reason: 'You need to login' //Optional
  },
  validate, // argument validation
  run // Method body
});
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].