Skip to content
/ tyrant Public
forked from apotonick/tyrant

Agnostic authentication gem with signup, signin, forgot password, sticky login, and so on.

License

Notifications You must be signed in to change notification settings

pacuum/tyrant

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tyrant

"Freedom choked in dread we live, since tyrant was enthroned."

Tyrant implements all common steps of authorization workflows using overridable operations. It allows a quick setup of sign in, sign up, forgot password, etc. Tryrant works well in Rails, but plays well with any Ruby environment.

Operations are provided for the following steps.

  • SignIn
    • Confirmed
    • Hammer protection (3x wrong blabla)
    • Sticky (Remember me)
  • SignUp
  • SignOut
  • ResetPassword
  • Forgot pw

Operations

trb instead of pushing into controller

Tyrant exposes its public API using operations.

Operations are the pivotal element in the Trailblazer architecture. When it comes to customization, Tyrant doesn't rely on a "hopefully complete" configuration language as Devise does it.

Tyrant allows you to customize with Ruby. You can override entire workflow steps (operations), forms and validations (contracts) or methods using simple object-orientation and a clean API.

This means you can easily use them in Rails controllers.

class SessionController < ApplicationController
  def sign_in
    run Tyrant::SignIn
  end

You can also run the public API in any other Ruby environment, e.g. a console or a Roda action.

Tyrant::SignIn.run(params)

Tyrant provides forms for all workflow steps. using Reform objects that are embedded into the operations.

=> Customize with inheritance, or override. Or just don't use the operation and write your own "step".

Installation

Add this line to your application's Gemfile:

gem 'tyrant'

Rails

Tyrant comes with a railtie to provide you an initializer. In Rails, add this to an initializer.

require "tyrant/railtie"

License

The gem is available as open source under the terms of the MIT License.

About

Agnostic authentication gem with signup, signin, forgot password, sticky login, and so on.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%