Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

UPDATE: configurable auth provider #934

Merged

Conversation

vkislichenko
Copy link
Contributor

@vkislichenko vkislichenko commented Aug 6, 2021

I'm sure there is a valid reasoning behind current logic of extending User model with shopify shop trait,
But I really do need them to be separate.

This PR provides one more shopify app config option shop_auth_provider ("users" by default)
Model is then taken from config auth.providers.{$config['shop_auth_provider']}.model

Works if manual migrations are used and user table is replaced with custom one
Models provided by this package will still reference custom model using user_id columns, but it seems like a minor detail related to bigger refactoring.

@gnikyt
Copy link
Owner

gnikyt commented Aug 9, 2021

Sounds good to me! Please see the failed lint, adjust, and I'll merge :)

@vkislichenko
Copy link
Contributor Author

@lucasmichot thanks for the fix,
I was offline on vacation this whole time :)

@osiset if there's anything else wrong with current PR - please let me know.

@vkislichenko
Copy link
Contributor Author

UPDATE: added config option shop_auth_guard
It's mostly to prevent use of custom default auth guards (like jwt), but it might be also useful in other cases when shop_auth_provider specifies a custom model

Copy link
Owner

@gnikyt gnikyt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple small issues to correct linting, then can be merged.

src/Http/Middleware/AuthProxy.php Outdated Show resolved Hide resolved
src/Http/Middleware/VerifyShopify.php Outdated Show resolved Hide resolved
@gnikyt
Copy link
Owner

gnikyt commented Sep 8, 2021

Checks passed, linting pass. Merging. Thanks @vkislichenko !

@gnikyt gnikyt merged commit b442357 into gnikyt:master Sep 8, 2021
@salahy
Copy link

salahy commented Nov 8, 2021

What about the migrations ? they still change the user model

@vkislichenko
Copy link
Contributor Author

@salahy

What about the migrations ? they still change the user model

there's "Manual migrations" in config
and command php artisan vendor:publish --tag=shopify-migrations to push migrations to your app's folder so you're free to modify before migrating.

@nahid
Copy link
Contributor

nahid commented Jan 24, 2022

When this changes will be released? @osiset

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants