migrate a functionality from spree_auth