mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 07:39:39 +02:00
fix: Only admins can generate invite codes (#1611)
* fix: Only admins can generate invite codes * fix: raise error if user is not an admin when creating invite codesss
This commit is contained in:
parent
0476f25952
commit
61321f6b16
3 changed files with 22 additions and 1 deletions
|
@ -6,6 +6,7 @@ class InviteCodesController < ApplicationController
|
|||
end
|
||||
|
||||
def create
|
||||
raise StandardError, "You are not allowed to generate invite codes" unless Current.user.admin?
|
||||
InviteCode.generate!
|
||||
redirect_back_or_to invite_codes_path, notice: "Code generated"
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue