1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 05:09:38 +02:00
Maybe/app/controllers/sessions_controller.rb
Rob Zolkos 1cc9550c80 Lint files to rubocop omakase standards
root ➜ /workspace (fix-rubocop-issues) $ rubocop
Inspecting 54 files
......................................................

54 files inspected, no offenses detected
2024-02-02 16:07:29 +00:00

21 lines
462 B
Ruby

class SessionsController < ApplicationController
layout "auth"
def new
end
def create
if user = User.authenticate_by(email: params[:email], password: params[:password])
login user
redirect_to root_path
else
flash.now[:alert] = "Invalid email or password."
render :new, status: :unprocessable_entity
end
end
def destroy
logout
redirect_to root_path, notice: "You have signed out successfully."
end
end