mirror of
https://github.com/we-promise/sure.git
synced 2026-04-20 04:24:06 +00: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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user