مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2026-01-18 13:59:47 +00:00
Add IP-based SMTP authentication (#1149)
هذا الالتزام موجود في:
ملتزم من قبل
GitHub
الأصل
5c7802d218
التزام
9a3d568b27
@@ -3,7 +3,7 @@ class CredentialsController < ApplicationController
|
||||
include WithinOrganization
|
||||
|
||||
before_action { @server = organization.servers.present.find_by_permalink!(params[:server_id]) }
|
||||
before_action { params[:id] && @credential = @server.credentials.find_by_key!(params[:id]) }
|
||||
before_action { params[:id] && @credential = @server.credentials.find_by_uuid!(params[:id]) }
|
||||
|
||||
def index
|
||||
@credentials = @server.credentials.order(:name).to_a
|
||||
@@ -14,7 +14,7 @@ class CredentialsController < ApplicationController
|
||||
end
|
||||
|
||||
def create
|
||||
@credential = @server.credentials.build(params.require(:credential).permit(:type, :name, :hold))
|
||||
@credential = @server.credentials.build(params.require(:credential).permit(:type, :name, :key, :hold))
|
||||
if @credential.save
|
||||
redirect_to_with_json [organization, @server, :credentials]
|
||||
else
|
||||
@@ -23,7 +23,7 @@ class CredentialsController < ApplicationController
|
||||
end
|
||||
|
||||
def update
|
||||
if @credential.update(params.require(:credential).permit(:name, :hold))
|
||||
if @credential.update(params.require(:credential).permit(:name, :key, :hold))
|
||||
redirect_to_with_json [organization, @server, :credentials]
|
||||
else
|
||||
render_form_errors 'edit', @credential
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم