SIGN UP ON FIRST PROJECT IT WILL AUTOMATICALLY LOGIN TO ANOTHER PROJECT SERVER


Sign up on first project it will automatically sign up to another project server

In first server code :-

Gemfile
        gem 'rest-client'


Controller

      def create
               # sign up on one server
               @user = User.create(name: params[:user][:name], email: params[:user][:email], password: params[:user][:password], password_confirmation: params[:user][:password_confirmation])

               # after login one server it will automatically on second server
               RestClient::Request.execute(method: :post, url: "https://ipaddress/domain/users", headers: {:params => {"user": {"name": "rohit", "email": "rohityuvasoft149@gmail.com", "password": "12345678", "password_confirmation": "12345678"}}}, verify_ssl: false)
    end
       end

In second server it will be sign up automatically.


Popular posts from this blog

UPLOAD ANY MEDIA FILE WITH CARRIER-WAVE RAILS

CREATE API FOR USER SIGN UP, LOGIN AND CREATE PUBLISHER WITH CURRENT USER

SELECT COUNTRY WITH STATE AND IT'S CITIES RAILS