Class: ReviseAuth::SessionsController

Inherits:
ReviseAuthController show all
Defined in:
app/controllers/revise_auth/sessions_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



9
10
11
12
13
14
15
16
17
# File 'app/controllers/revise_auth/sessions_controller.rb', line 9

def create
  if (user = User.authenticate_by(email: params[:email], password: params[:password]))
    (user)
    redirect_to 
  else
    flash[:alert] = t(".invalid_email_or_password")
    render :new, status: :unprocessable_entity
  end
end

#destroyObject



19
20
21
22
# File 'app/controllers/revise_auth/sessions_controller.rb', line 19

def destroy
  logout
  redirect_to root_path
end

#newObject



6
7
# File 'app/controllers/revise_auth/sessions_controller.rb', line 6

def new
end