def sign_in(user, &block)
      @current_user = user
      status = run_sign_in_stack

      if status.success?
        # Sign in succeeded, and when {RackSession} is run and calls
        # {#add_cookie_to_headers} it will set the cookie with the
        # remember_token for the current_user
      else
        @current_user = nil
      end

      if block_given?
        block.call(status)
      end
    end
def sign_in(user, &block)
      @current_user = user
      status = run_sign_in_stack

      if status.success?
        # Sign in succeeded, and when {RackSession} is run and calls
        # {#add_cookie_to_headers} it will set the cookie with the
        # remember_token for the current_user
      else
        @current_user = nil
      end

      if block_given?
        block.call(status)
      end
    end
Sign the provided user in, if approved by the configured sign in guards.
 If the sign in guard stack returns {SuccessStatus}, the {#current_user}
 will be set and then remember token cookie will be set to the user's
 remember token. If the stack returns {FailureStatus}, {#current_user} will
 be nil.

 In either event, the resulting status will be yielded to a provided block,
 if provided. See {SessionsController#create} for an example of how this
 can be used.

 @param [User] user
 @yieldparam [SuccessStatus,FailureStatus] status Result of the sign in
   operation.
 @return [void]