Skip to content

Gerenciador de tarefas clássico e com recursos para exportar em CSV

Notifications You must be signed in to change notification settings

treinalinux/todo

Repository files navigation

README

Authenticate with http

credentials encrypted

EDITOR="vim" bin/rails credentials:edit
...
authentication:
  username: 'alan'
  password: 'senhaSecreta'

Testing on Rails c

rails c

irb(main):001:0> Rails.application.credentials.authentication
=> {:username=>"alan", :password=>"senhaSecreta"}
irb(main):002:0> Rails.application.credentials.authentication[:username]
=> "alan"
 vim app/controllers/application_controller.rb

# frozen_string_literal: true

# class ApplicationController
class ApplicationController < ActionController::Base
  before_action :authenticate

  def authenticate
    authenticate_or_request_with_http_basic do |username, password|
      username == Rails.application.credentials.authentication[:username] &&
        password == Rails.application.credentials.authentication[:password]
    end
  end
end

About

Gerenciador de tarefas clássico e com recursos para exportar em CSV

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published