mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-14 00:08:46 +00:00
Merge commit 'a863e68d174b176dc350d8e3472c010cd37b7807' into glitch-soc/merge-upstream
Conflicts: - `app/models/trends/statuses.rb`: Conflict because of glitch-soc's setting to allow CWs in trends. Kept glitch-soc's setting but followed upstream's refactor. - `docker-compose.yml`: Conflict because of upstream VS glitch-soc repos. Updated version number as upstream did, but kept glitch-soc repos.
This commit is contained in:
@@ -19,15 +19,13 @@ module Admin
|
||||
|
||||
log_action :resend, @user
|
||||
|
||||
flash[:notice] = I18n.t('admin.accounts.resend_confirmation.success')
|
||||
redirect_to admin_accounts_path
|
||||
redirect_to admin_accounts_path, notice: t('admin.accounts.resend_confirmation.success')
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def redirect_confirmed_user
|
||||
flash[:error] = I18n.t('admin.accounts.resend_confirmation.already_confirmed')
|
||||
redirect_to admin_accounts_path
|
||||
redirect_to admin_accounts_path, flash: { error: t('admin.accounts.resend_confirmation.already_confirmed') }
|
||||
end
|
||||
|
||||
def user_confirmed?
|
||||
|
||||
@@ -14,8 +14,7 @@ module Admin
|
||||
@admin_settings = Form::AdminSettings.new(settings_params)
|
||||
|
||||
if @admin_settings.save
|
||||
flash[:notice] = I18n.t('generic.changes_saved_msg')
|
||||
redirect_to after_update_redirect_path
|
||||
redirect_to after_update_redirect_path, notice: t('generic.changes_saved_msg')
|
||||
else
|
||||
render :show
|
||||
end
|
||||
|
||||
@@ -16,16 +16,7 @@ class Api::V1::Push::SubscriptionsController < Api::BaseController
|
||||
def create
|
||||
with_redis_lock("push_subscription:#{current_user.id}") do
|
||||
destroy_web_push_subscriptions!
|
||||
|
||||
@push_subscription = Web::PushSubscription.create!(
|
||||
endpoint: subscription_params[:endpoint],
|
||||
key_p256dh: subscription_params[:keys][:p256dh],
|
||||
key_auth: subscription_params[:keys][:auth],
|
||||
standard: subscription_params[:standard] || false,
|
||||
data: data_params,
|
||||
user_id: current_user.id,
|
||||
access_token_id: doorkeeper_token.id
|
||||
)
|
||||
@push_subscription = Web::PushSubscription.create!(web_push_subscription_params)
|
||||
end
|
||||
|
||||
render json: @push_subscription, serializer: REST::WebPushSubscriptionSerializer
|
||||
@@ -55,6 +46,18 @@ class Api::V1::Push::SubscriptionsController < Api::BaseController
|
||||
not_found if @push_subscription.nil?
|
||||
end
|
||||
|
||||
def web_push_subscription_params
|
||||
{
|
||||
access_token_id: doorkeeper_token.id,
|
||||
data: data_params,
|
||||
endpoint: subscription_params[:endpoint],
|
||||
key_auth: subscription_params[:keys][:auth],
|
||||
key_p256dh: subscription_params[:keys][:p256dh],
|
||||
standard: subscription_params[:standard] || false,
|
||||
user_id: current_user.id,
|
||||
}
|
||||
end
|
||||
|
||||
def subscription_params
|
||||
params.expect(subscription: [:endpoint, :standard, keys: [:auth, :p256dh]])
|
||||
end
|
||||
|
||||
@@ -49,7 +49,7 @@ class Api::Web::PushSubscriptionsController < Api::Web::BaseController
|
||||
{
|
||||
policy: 'all',
|
||||
alerts: Notification::TYPES.index_with { alerts_enabled },
|
||||
}
|
||||
}.deep_stringify_keys
|
||||
end
|
||||
|
||||
def alerts_enabled
|
||||
|
||||
@@ -19,8 +19,7 @@ class Auth::PasswordsController < Devise::PasswordsController
|
||||
private
|
||||
|
||||
def redirect_invalid_reset_token
|
||||
flash[:error] = I18n.t('auth.invalid_reset_password_token')
|
||||
redirect_to new_password_path(resource_name)
|
||||
redirect_to new_password_path(resource_name), flash: { error: t('auth.invalid_reset_password_token') }
|
||||
end
|
||||
|
||||
def reset_password_token_is_valid?
|
||||
|
||||
@@ -8,8 +8,7 @@ class Settings::SessionsController < Settings::BaseController
|
||||
|
||||
def destroy
|
||||
@session.destroy!
|
||||
flash[:notice] = I18n.t('sessions.revoke_success')
|
||||
redirect_to edit_user_registration_path
|
||||
redirect_to edit_user_registration_path, notice: t('sessions.revoke_success')
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -86,13 +86,11 @@ module Settings
|
||||
private
|
||||
|
||||
def redirect_invalid_otp
|
||||
flash[:error] = t('webauthn_credentials.otp_required')
|
||||
redirect_to settings_two_factor_authentication_methods_path
|
||||
redirect_to settings_two_factor_authentication_methods_path, flash: { error: t('webauthn_credentials.otp_required') }
|
||||
end
|
||||
|
||||
def redirect_invalid_webauthn
|
||||
flash[:error] = t('webauthn_credentials.not_enabled')
|
||||
redirect_to settings_two_factor_authentication_methods_path
|
||||
redirect_to settings_two_factor_authentication_methods_path, flash: { error: t('webauthn_credentials.not_enabled') }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user