If you need the shipping address to be set any how, and want to skip the validations as set in the spree’s address model, you can do it easily
class Address < Spree::Base
belongs_to :country, class_name: "Spree::Country"
belongs_to :state, class_name: "Spree::State"
has_many :shipments, inverse_of: :address
validates :firstname, :lastname, :address1, :city, :country, presence: true
validates :zipcode, presence: true, if: :require_zipcode?
validates :phone, presence: true, if: :require_phone?
validate :state_validate, :postal_code_validate
And you are done
If you already have billing/shipping address and payment info of the store in the OAuth provider [eg. some app with Doorkeeper]; and you don’t want to let your users go through the hassle to fill the form all over again, then, you can reuse the data. For this, you need to return the info along with user info from the OAuth provider in the response.
# in /app/models/spree/user_decorator.rb
class << self
spree_user = get_or_set_user(auth_data)
# Extract address info from the payload and update
# can update only shipping or both address with same data
set_shipping_address(spree_user, auth_data) if spree_user.ship_address.nil?
set_billing_address (spree_user, auth_data) if spree_user.bill_address.nil?
# You might also import PaymentSource info from parent app
# Ex: User has already submitted payment info [CreditCard info] and
# and you have Stripe PaymentSource Id, then you can import the data
# along with other info. I recommend you to use HTTPS for this.
set_payment_source(spree_user, auth_data) if spree_user.payment_sources.blank?
# Set user's role; say in parent app the user is Admin, then you
# might want to set that user as an Admin in child app as well.
# See the function definition below
# Need to return the user object
# all the methods assisting '
from_omniauth' will go below here