mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-19 05:09:38 +02:00
Initial commit
This commit is contained in:
commit
99de24ac70
147 changed files with 3519 additions and 0 deletions
22
app/controllers/sessions_controller.rb
Normal file
22
app/controllers/sessions_controller.rb
Normal file
|
@ -0,0 +1,22 @@
|
|||
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
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue