Introduction
Introduction Statistics Contact Development Disclaimer Help
user_sessions_controller.rb - warvox - VoIP based wardialing tool, forked from …
git clone git://jay.scot/warvox
Log
Files
Refs
README
---
user_sessions_controller.rb (618B)
---
1 class UserSessionsController < ApplicationController
2 before_action :require_no_user, only: [:new, :create]
3 before_action :require_user, only: :destroy
4 layout 'login'
5
6 def new
7 @user_session = UserSession.new
8 end
9
10 def create
11 @user_session = UserSession.new(user_session_params)
12 if @user_session.save
13 redirect_back_or_default projects_path
14 else
15 render action: :new
16 end
17 end
18
19 def destroy
20 current_user_session.destroy
21 redirect_back_or_default login_path
22 end
23
24 private
25
26 def user_session_params
27 params.require(:user_session).permit(:login, :password)
28 end
29 end
You are viewing proxied material from jay.scot. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.