mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-19 05:09:38 +02:00
* Add i18n-tasks
* Add auth-related i18n
* Centralize auth messages
* Remove safe navigation
* Revert "Remove safe navigation"
This reverts commit 56b5e01e5e
.
* Remove newline in Gemfile
21 lines
447 B
Ruby
21 lines
447 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] = t(".invalid_credentials")
|
|
render :new, status: :unprocessable_entity
|
|
end
|
|
end
|
|
|
|
def destroy
|
|
logout
|
|
redirect_to root_path, notice: t(".logout_successful")
|
|
end
|
|
end
|