users: lock out users with invalid names until they change their name.

Forcibly redirect users to the name change page if their name is
invalid. This means user with invalid names can't do anything or view
any pages until they change their name. API requests are still allowed.
This commit is contained in:
evazion
2022-03-07 04:21:17 -06:00
parent 1028bb1c71
commit 525acd17a5
3 changed files with 12 additions and 3 deletions

View File

@@ -3,6 +3,8 @@
class UserNameChangeRequestsController < ApplicationController
respond_to :html, :json, :xml
skip_before_action :redirect_if_name_invalid?
def new
@change_request = authorize UserNameChangeRequest.new(permitted_attributes(UserNameChangeRequest))
respond_with(@change_request)