Sha256: b6134c252b0c6a85fa5d18ca05c58ea7533b026bab0d7d487cc7be27f2d254a7

Contents?: true

Size: 385 Bytes

Versions: 4

Compression:

Stored size: 385 Bytes

Contents

SimpleTokenAuth.configure do |config|
  config.find_scope_strategy = -> (scope_class, token) do
    field, token = token.split('.')
    scope = scope_class.find(field.to_i)
    [scope, token]
  end

  config.after_authenticated_strategy = -> (scope, controller) do
    # Devise way of after authenticated a user
    controller.sign_in scope, {}
  end

  config.expire_in = 3.hours
end

Version data entries

4 entries across 2 versions & 1 rubygems

Version Path
simple_token_auth-0.0.4 lib/generators/templates/simple_token_auth.rb
simple_token_auth-0.0.4 test/dummy/config/initializers/simple_token_auth.rb
simple_token_auth-0.0.3 lib/generators/templates/simple_token_auth.rb
simple_token_auth-0.0.3 test/dummy/config/initializers/simple_token_auth.rb