mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-23 19:18:07 +01:00
771c9d4ba8
Remove "active within last two weeks" exception for sign in token requirement Change admin reset password to lock access until the password is reset
27 lines
695 B
Ruby
27 lines
695 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Admin
|
|
class SignInTokenAuthenticationsController < BaseController
|
|
before_action :set_target_user
|
|
|
|
def create
|
|
authorize @user, :enable_sign_in_token_auth?
|
|
@user.update(skip_sign_in_token: false)
|
|
log_action :enable_sign_in_token_auth, @user
|
|
redirect_to admin_account_path(@user.account_id)
|
|
end
|
|
|
|
def destroy
|
|
authorize @user, :disable_sign_in_token_auth?
|
|
@user.update(skip_sign_in_token: true)
|
|
log_action :disable_sign_in_token_auth, @user
|
|
redirect_to admin_account_path(@user.account_id)
|
|
end
|
|
|
|
private
|
|
|
|
def set_target_user
|
|
@user = User.find(params[:user_id])
|
|
end
|
|
end
|
|
end
|