module SimpleTokenAuth

Usage:

class ApplicationController

include SimpleTokenAuth::AuthenticateWithToken

end

class UserController < ApplicationController

prepend_before_action :authenticate_user_from_token!

end

github.com/plataformatec/devise

Ensures a token is generated

class User < ActiveRecord::Base

include SimpleTokenAuth::TokenAuthenticatable

end

Constants

VERSION

Public Class Methods

after_authenticated(scope, controller) click to toggle source
# File lib/simple_token_auth.rb, line 21
def after_authenticated(scope, controller)
  after_authenticated_strategy.(scope, controller)
end
compare_token(a, b) click to toggle source
# File lib/simple_token_auth.rb, line 9
def compare_token(a, b)
  compare_token_strategy.(a, b)
end
find_scope(scope_class, token) click to toggle source
# File lib/simple_token_auth.rb, line 17
def find_scope(scope_class, token)
  find_scope_strategy.(scope_class, token)
end
generate_authentication_token() click to toggle source
# File lib/simple_token_auth.rb, line 13
def generate_authentication_token
  generate_authentication_token_strategy.()
end