-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* a10n * Add missed test credentials * a10n specs * Allow CI for PR to develop * Linting fix * Remove unused devise mail templates * Edit profile * Add credentials test key to CI * Delete config/credentials/test.key * Attempt to fix test credentials problem * LOL * Uncomment devise mailer in initializer * Attempt to ignore mailer * Follow up * Oops * Back and forth * And another one
- Loading branch information
Showing
36 changed files
with
848 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,15 @@ | ||
class ApplicationController < ActionController::Base | ||
before_action :configure_permitted_parameters, if: :devise_controller? | ||
|
||
protected | ||
|
||
def configure_permitted_parameters | ||
devise_parameter_sanitizer.permit(:sign_up, keys: [:username]) | ||
devise_parameter_sanitizer.permit(:sign_in, keys: [:username]) | ||
devise_parameter_sanitizer.permit(:account_update, keys: [:username]) | ||
end | ||
|
||
def after_sign_in_path_for(resource) | ||
tweets_path | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# == Schema Information | ||
# | ||
# Table name: users | ||
# | ||
# id :bigint not null, primary key | ||
# encrypted_password :string default(""), not null | ||
# remember_created_at :datetime | ||
# username :string default(""), not null | ||
# created_at :datetime not null | ||
# updated_at :datetime not null | ||
# | ||
# Indexes | ||
# | ||
# index_users_on_username (username) UNIQUE | ||
# | ||
class User < ApplicationRecord | ||
devise :database_authenticatable, :registerable, | ||
:rememberable, :validatable | ||
validates :username, presence: true, uniqueness: {case_sensitive: false} | ||
|
||
def email_required? | ||
false | ||
end | ||
|
||
def email_changed? | ||
false | ||
end | ||
|
||
def will_save_change_to_email? | ||
false | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
h2 Resend confirmation instructions | ||
|
||
= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| | ||
= render "devise/shared/error_messages", resource: resource | ||
|
||
.field | ||
= f.label :username, class: 'label' | ||
.control | ||
= f.text_field :username, autofocus: true, autocomplete: "username", class: 'input', value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.username) | ||
|
||
.field.is-grouped | ||
.control | ||
= f.submit "Resend confirmation instructions", class: 'button is-link' | ||
|
||
= render "devise/shared/links" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
h2.title Change your password | ||
|
||
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| | ||
= render "devise/shared/error_messages", resource: resource | ||
= f.hidden_field :reset_password_token | ||
|
||
.field | ||
= f.label :password, "New password", class: 'label' | ||
- if @minimum_password_length | ||
em (#{@minimum_password_length} characters minimum) | ||
.control | ||
= f.password_field :password, autofocus: true, autocomplete: "new-password", class: 'input' | ||
|
||
.field | ||
= f.label :password_confirmation, "Confirm new password", class: 'label' | ||
.control | ||
= f.password_field :password_confirmation, autocomplete: "new-password", class: 'input' | ||
|
||
.field.is-grouped | ||
.control | ||
= f.submit "Change my password", class: 'button is-link' | ||
|
||
= render "devise/shared/links" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
h2.title Forgot your password? | ||
|
||
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| | ||
= render "devise/shared/error_messages", resource: resource | ||
|
||
.field | ||
= f.label :username, class: 'label' | ||
.control | ||
= f.text_field :username, autofocus: true, autocomplete: "username", class: 'input' | ||
|
||
.field.is-grouped | ||
.control | ||
= f.submit "Send me reset password instructions", class: 'button is-link' | ||
|
||
= render "devise/shared/links" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
h2.title Edit #{resource_name.to_s.humanize} | ||
|
||
= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| | ||
= render "devise/shared/error_messages", resource: resource | ||
|
||
.field | ||
= f.label :username, class: 'label' | ||
.control | ||
= f.text_field :username, autofocus: true, autocomplete: "username", class: 'input' | ||
|
||
.field | ||
= f.label :password, class: 'label' | ||
i #{"(leave blank if you don't want to change it)"} | ||
.control | ||
= f.password_field :password, autocomplete: "new-password", class: 'input' | ||
- if @minimum_password_length | ||
br | ||
em #{@minimum_password_length} characters minimum | ||
|
||
.field | ||
= f.label :password_confirmation, class: 'label' | ||
.control | ||
= f.password_field :password_confirmation, autocomplete: "new-password", class: 'input' | ||
|
||
.field | ||
= f.label :current_password, class: 'label' | ||
i #{"(we need your current password to confirm your changes)"} | ||
.control | ||
= f.password_field :current_password, autocomplete: "current-password", class: 'input' | ||
|
||
.field.is-grouped | ||
.control | ||
= f.submit "Update", class: 'button is-link' | ||
|
||
h3 Cancel my account | ||
|
||
.notification | ||
| Unhappy? | ||
= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?", turbo_confirm: "Are you sure?" }, method: :delete, class: 'button is-danger' | ||
|
||
= link_to "Back", :back, class: 'button is-light' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
h2.title Sign up | ||
|
||
= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| | ||
= render "devise/shared/error_messages", resource: resource | ||
|
||
.field | ||
= f.label :username, class: 'label' | ||
.control | ||
= f.text_field :username, autofocus: true, autocomplete: "username", class: 'input' | ||
|
||
.field | ||
= f.label :password, class: 'label' | ||
- if @minimum_password_length | ||
em | ||
= @minimum_password_length | ||
| characters minimum | ||
.control | ||
= f.password_field :password, autocomplete: "new-password", class: 'input' | ||
|
||
.field | ||
= f.label :password_confirmation, class: 'label' | ||
.control | ||
= f.password_field :password_confirmation, autocomplete: "new-password", class: 'input' | ||
|
||
.field.is-grouped | ||
.control | ||
= f.submit "Sign up", class: 'button is-link' | ||
|
||
= render "devise/shared/links" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
h2.title Log in | ||
|
||
= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| | ||
.field | ||
= f.label :username, class: 'label' | ||
.control | ||
= f.text_field :username, autofocus: true, autocomplete: "username", class: 'input' | ||
|
||
.field | ||
= f.label :password, class: 'label' | ||
.control | ||
= f.password_field :password, autocomplete: "current-password", class: 'input' | ||
|
||
- if devise_mapping.rememberable? | ||
.field | ||
.control | ||
label.checkbox | ||
= f.check_box :remember_me | ||
| Remember me | ||
|
||
.field.is-grouped | ||
.control | ||
= f.submit "Log in", class: 'button is-link' | ||
|
||
= render "devise/shared/links" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
- if resource.errors.any? | ||
#error_explanation data-turbo-cache="false" | ||
h2 | ||
= I18n.t("errors.messages.not_saved", | ||
count: resource.errors.count, | ||
resource: resource.class.model_name.human.downcase) | ||
ul | ||
- resource.errors.full_messages.each do |message| | ||
li= message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
.nav.level | ||
- if controller_name != 'sessions' | ||
= link_to "Log in", new_session_path(resource_name), class: 'level-item' | ||
br | ||
|
||
- if devise_mapping.registerable? && controller_name != 'registrations' | ||
= link_to "Sign up", new_registration_path(resource_name), class: 'level-item' | ||
br | ||
|
||
- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' | ||
= link_to "Forgot your password?", new_password_path(resource_name), class: 'level-item' | ||
br | ||
|
||
- if devise_mapping.confirmable? && controller_name != 'confirmations' | ||
= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name), class: 'level-item' | ||
br | ||
|
||
- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' | ||
= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name), class: 'level-item' | ||
br | ||
|
||
- if devise_mapping.omniauthable? | ||
- resource_class.omniauth_providers.each do |provider| | ||
= button_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), data: { turbo: false }, class: 'button is-link level-item' | ||
br |
Oops, something went wrong.