tap/app/controllers/welcome_controller.rb

18 lines
409 B
Ruby
Raw Normal View History

class WelcomeController < ApplicationController
skip_before_filter :verify_authenticity_token, only: :token_sign_in
def index
2016-03-03 22:30:23 +01:00
sign_in User.find_by(name: "tleilaxu")
end
def token_sign_in
2015-10-07 15:10:14 +02:00
if user_signed_in? || params[:token] != Rails.application.secrets.koelkast_token
2015-10-07 15:06:01 +02:00
redirect_to root_path
return
end
koelkast = User.koelkast
sign_in_and_redirect koelkast
end
end