From 134bf27955e6caab0f7cc731f72551daae6f2a17 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Mon, 18 Nov 2024 23:27:50 +0000 Subject: [PATCH] Add copyright notice --- app/channels/application_cable/connection.rb | 2 ++ app/controllers/concerns/authentication.rb | 2 ++ app/controllers/passwords_controller.rb | 2 ++ app/controllers/sessions_controller.rb | 2 ++ app/mailers/passwords_mailer.rb | 2 ++ app/models/current.rb | 2 ++ app/models/session.rb | 2 ++ app/models/user.rb | 2 ++ app/views/passwords/edit.html.erb | 2 ++ app/views/passwords/new.html.erb | 2 ++ app/views/passwords_mailer/reset.html.erb | 2 ++ app/views/passwords_mailer/reset.text.erb | 2 ++ app/views/sessions/new.html.erb | 2 ++ db/migrate/20241118232609_create_users.rb | 2 ++ db/migrate/20241118232618_create_sessions.rb | 2 ++ db/schema.rb | 2 ++ 16 files changed, 32 insertions(+) diff --git a/app/channels/application_cable/connection.rb b/app/channels/application_cable/connection.rb index 4264c74..abaef27 100644 --- a/app/channels/application_cable/connection.rb +++ b/app/channels/application_cable/connection.rb @@ -1,3 +1,5 @@ +# Copyright (C) 2024 Manuel Bustillo + module ApplicationCable class Connection < ActionCable::Connection::Base identified_by :current_user diff --git a/app/controllers/concerns/authentication.rb b/app/controllers/concerns/authentication.rb index 771b21d..5275e10 100644 --- a/app/controllers/concerns/authentication.rb +++ b/app/controllers/concerns/authentication.rb @@ -1,3 +1,5 @@ +# Copyright (C) 2024 Manuel Bustillo + module Authentication extend ActiveSupport::Concern diff --git a/app/controllers/passwords_controller.rb b/app/controllers/passwords_controller.rb index 0c4b4a8..49e8595 100644 --- a/app/controllers/passwords_controller.rb +++ b/app/controllers/passwords_controller.rb @@ -1,3 +1,5 @@ +# Copyright (C) 2024 Manuel Bustillo + class PasswordsController < ApplicationController allow_unauthenticated_access before_action :set_user_by_token, only: %i[ edit update ] diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 9785c92..6a46998 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,3 +1,5 @@ +# Copyright (C) 2024 Manuel Bustillo + class SessionsController < ApplicationController allow_unauthenticated_access only: %i[ new create ] rate_limit to: 10, within: 3.minutes, only: :create, with: -> { redirect_to new_session_url, alert: "Try again later." } diff --git a/app/mailers/passwords_mailer.rb b/app/mailers/passwords_mailer.rb index 4f0ac7f..f3692f0 100644 --- a/app/mailers/passwords_mailer.rb +++ b/app/mailers/passwords_mailer.rb @@ -1,3 +1,5 @@ +# Copyright (C) 2024 Manuel Bustillo + class PasswordsMailer < ApplicationMailer def reset(user) @user = user diff --git a/app/models/current.rb b/app/models/current.rb index 2bef56d..f7b1ab9 100644 --- a/app/models/current.rb +++ b/app/models/current.rb @@ -1,3 +1,5 @@ +# Copyright (C) 2024 Manuel Bustillo + class Current < ActiveSupport::CurrentAttributes attribute :session delegate :user, to: :session, allow_nil: true diff --git a/app/models/session.rb b/app/models/session.rb index 688bbd3..9ba68b4 100644 --- a/app/models/session.rb +++ b/app/models/session.rb @@ -1,3 +1,5 @@ +# Copyright (C) 2024 Manuel Bustillo + # == Schema Information # # Table name: sessions diff --git a/app/models/user.rb b/app/models/user.rb index 6b2fd8a..6c752a9 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,3 +1,5 @@ +# Copyright (C) 2024 Manuel Bustillo + # == Schema Information # # Table name: users diff --git a/app/views/passwords/edit.html.erb b/app/views/passwords/edit.html.erb index 9f0c87c..8b76bbf 100644 --- a/app/views/passwords/edit.html.erb +++ b/app/views/passwords/edit.html.erb @@ -1,3 +1,5 @@ +<%# Copyright (C) 2024 Manuel Bustillo %> +

Update your password

<%= tag.div(flash[:alert], style: "color:red") if flash[:alert] %> diff --git a/app/views/passwords/new.html.erb b/app/views/passwords/new.html.erb index 44efb2b..2572313 100644 --- a/app/views/passwords/new.html.erb +++ b/app/views/passwords/new.html.erb @@ -1,3 +1,5 @@ +<%# Copyright (C) 2024 Manuel Bustillo %> +

Forgot your password?

<%= tag.div(flash[:alert], style: "color:red") if flash[:alert] %> diff --git a/app/views/passwords_mailer/reset.html.erb b/app/views/passwords_mailer/reset.html.erb index 4a06619..9b536ff 100644 --- a/app/views/passwords_mailer/reset.html.erb +++ b/app/views/passwords_mailer/reset.html.erb @@ -1,3 +1,5 @@ +<%# Copyright (C) 2024 Manuel Bustillo %> +

You can reset your password within the next 15 minutes on <%= link_to "this password reset page", edit_password_url(@user.password_reset_token) %>. diff --git a/app/views/passwords_mailer/reset.text.erb b/app/views/passwords_mailer/reset.text.erb index 2cf03fc..0ce9c12 100644 --- a/app/views/passwords_mailer/reset.text.erb +++ b/app/views/passwords_mailer/reset.text.erb @@ -1,2 +1,4 @@ +<%# Copyright (C) 2024 Manuel Bustillo %> + You can reset your password within the next 15 minutes on this password reset page: <%= edit_password_url(@user.password_reset_token) %> diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index ff641c4..e78774d 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -1,3 +1,5 @@ +<%# Copyright (C) 2024 Manuel Bustillo %> + <%= tag.div(flash[:alert], style: "color:red") if flash[:alert] %> <%= tag.div(flash[:notice], style: "color:green") if flash[:notice] %> diff --git a/db/migrate/20241118232609_create_users.rb b/db/migrate/20241118232609_create_users.rb index 2075edf..b1f1381 100644 --- a/db/migrate/20241118232609_create_users.rb +++ b/db/migrate/20241118232609_create_users.rb @@ -1,3 +1,5 @@ +# Copyright (C) 2024 Manuel Bustillo + class CreateUsers < ActiveRecord::Migration[8.0] def change create_table :users do |t| diff --git a/db/migrate/20241118232618_create_sessions.rb b/db/migrate/20241118232618_create_sessions.rb index 8102f13..3cc4be3 100644 --- a/db/migrate/20241118232618_create_sessions.rb +++ b/db/migrate/20241118232618_create_sessions.rb @@ -1,3 +1,5 @@ +# Copyright (C) 2024 Manuel Bustillo + class CreateSessions < ActiveRecord::Migration[8.0] def change create_table :sessions do |t| diff --git a/db/schema.rb b/db/schema.rb index 98095a5..02eeea6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1,3 +1,5 @@ +# Copyright (C) 2024 Manuel Bustillo + # This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition.