add new api
This commit is contained in:
@@ -29,10 +29,10 @@ class UsersController < ApplicationController
|
||||
@user = User.new(user_params)
|
||||
email=params[:registered_email]
|
||||
@user.is_active=true
|
||||
cipher = OpenSSL::Cipher::Cipher.new("aes-256-cbc")
|
||||
key=cipher.random_key
|
||||
secrect_key= Base64.encode64(key)
|
||||
@user.secrect_key=secrect_key
|
||||
# cipher = OpenSSL::Cipher::Cipher.new("aes-256-cbc")
|
||||
# key=cipher.random_key
|
||||
# secrect_key= Base64.encode64(key)
|
||||
# @user.secrect_key=secrect_key
|
||||
@email=email
|
||||
respond_to do |format|
|
||||
if @user.save
|
||||
@@ -100,6 +100,6 @@ class UsersController < ApplicationController
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def user_params
|
||||
params.require(:user).permit(:name, :nrc, :email, :phone, :address,:is_active,:secrect_key)
|
||||
params.require(:user).permit(:name, :nrc, :email, :phone, :address,:is_active)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user