1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 13:19:39 +02:00
This commit is contained in:
Josh Pigford 2024-02-02 10:39:17 -06:00
commit 55c352e8ef
11 changed files with 14 additions and 18 deletions

View file

@ -32,10 +32,10 @@ gem "jbuilder"
# Use Redis adapter to run Action Cable in production # Use Redis adapter to run Action Cable in production
gem "redis", ">= 4.0.1" gem "redis", ">= 4.0.1"
# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis] # Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
# gem "kredis" # gem "kredis"
# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword] # Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
gem "bcrypt", "~> 3.1.7" gem "bcrypt", "~> 3.1.7"
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem # Windows does not include zoneinfo files, so bundle the tzinfo-data gem

View file

@ -106,7 +106,7 @@ GEM
bindex (0.8.1) bindex (0.8.1)
bootsnap (1.18.3) bootsnap (1.18.3)
msgpack (~> 1.2) msgpack (~> 1.2)
brakeman (6.1.1) brakeman (6.1.2)
racc racc
builder (3.2.4) builder (3.2.4)
capybara (3.40.0) capybara (3.40.0)

View file

@ -20,7 +20,7 @@ class ApplicationController < ActionController::Base
def authenticate_user_from_session def authenticate_user_from_session
User.find_by(id: session[:user_id]) User.find_by(id: session[:user_id])
end end
def user_signed_in? def user_signed_in?
current_user.present? current_user.present?

View file

@ -1,6 +1,6 @@
class PagesController < ApplicationController class PagesController < ApplicationController
before_action :authenticate_user! before_action :authenticate_user!
def dashboard def dashboard
end end
end end

View file

@ -1,6 +1,6 @@
class PasswordResetsController < ApplicationController class PasswordResetsController < ApplicationController
layout "auth" layout "auth"
def new def new
end end
@ -37,4 +37,3 @@ class PasswordResetsController < ApplicationController
params.require(:user).permit(:password, :password_confirmation) params.require(:user).permit(:password, :password_confirmation)
end end
end end

View file

@ -18,4 +18,3 @@ class PasswordsController < ApplicationController
params.require(:user).permit(:password, :password_confirmation, :password_challenge).with_defaults(password_challenge: "") params.require(:user).permit(:password, :password_confirmation, :password_challenge).with_defaults(password_challenge: "")
end end
end end

View file

@ -1,6 +1,6 @@
class RegistrationsController < ApplicationController class RegistrationsController < ApplicationController
layout "auth" layout "auth"
def new def new
@user = User.new @user = User.new
end end
@ -27,4 +27,3 @@ class RegistrationsController < ApplicationController
params.require(:user).permit(:name, :email, :password, :password_confirmation) params.require(:user).permit(:name, :email, :password, :password_confirmation)
end end
end end

View file

@ -1,6 +1,6 @@
class SessionsController < ApplicationController class SessionsController < ApplicationController
layout "auth" layout "auth"
def new def new
end end
@ -13,10 +13,9 @@ class SessionsController < ApplicationController
render :new, status: :unprocessable_entity render :new, status: :unprocessable_entity
end end
end end
def destroy def destroy
logout logout
redirect_to root_path, notice: "You have signed out successfully." redirect_to root_path, notice: "You have signed out successfully."
end end
end end

View file

@ -1,3 +1,3 @@
class Current < ActiveSupport::CurrentAttributes class Current < ActiveSupport::CurrentAttributes
attribute :user attribute :user
end end

View file

@ -1,10 +1,10 @@
class User < ApplicationRecord class User < ApplicationRecord
has_secure_password has_secure_password
belongs_to :family belongs_to :family
validates :email, presence: true, uniqueness: true validates :email, presence: true, uniqueness: true
normalizes :email, with: -> (email) { email.strip.downcase } normalizes :email, with: ->(email) { email.strip.downcase }
generates_token_for :password_reset, expires_in: 15.minutes do generates_token_for :password_reset, expires_in: 15.minutes do
password_salt&.last(10) password_salt&.last(10)

View file

@ -1,3 +1,3 @@
Rails.application.config.generators do |g| Rails.application.config.generators do |g|
g.orm :active_record, primary_key_type: :uuid g.orm :active_record, primary_key_type: :uuid
end end