Sha256: 801e408181858f941feab6a6a0802e81f5606d8f7e3575efd28f36672af50507

Contents?: true

Size: 929 Bytes

Versions: 4

Compression:

Stored size: 929 Bytes

Contents

# frozen_string_literal: true

AuthRails.configure do |config|
  config.jwt do |jwt|
    jwt.access_token do |access_token|
      access_token.exp = 1.hour.since
      access_token.secret_key = ENV.fetch('JWT_SECRET', '')
    end

    <%= @is_allowed_token ? '' : '# ' %>jwt.strategy = AuthRails::Strategies::AllowedTokenStrategy

    # if you wanna use refresh token
    # uncomment those lines below
    # jwt.refresh_token do |refresh_token|
    #   refresh_token.http_only = true
    #   refresh_token.exp = 1.year.since
    #   refresh_token.algorithm = 'HS256'
    #   refresh_token.cookie_key = :ref_tok
    #   refresh_token.secret_key = ENV.fetch('JWT_SECRET', '')
    # end
  end
end

Rails.application.config.to_prepare do
  AuthRails.configure do |config|
    config.resource_class = <%= @model %>

    # if you wanna use custom error classes
    # uncomment code below
    # config.error_class = AuthError
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
auth_rails-1.1.2 lib/generators/templates/auth_rails.tt
auth_rails-1.1.1 lib/generators/templates/auth_rails.tt
auth_rails-1.1.0 lib/generators/templates/auth_rails.tt
auth_rails-1.0.2 lib/generators/templates/auth_rails.tt