tap/app/controllers/welcome_controller.rb

13 lines
345 B
Ruby

class WelcomeController < ApplicationController
skip_before_filter :verify_authenticity_token, only: :token_sign_in
def index
end
def token_sign_in
return head(:unauthorized) unless params[:token] == Rails.application.secrets.koelkast_token
koelkast = User.find_by(name: "koelkast")
sign_in_and_redirect koelkast
end
end