Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.x] Document Credential Storages and Refactored Auth User Store to support different guards #122

Merged
merged 8 commits into from
Nov 27, 2024

Conversation

JamesFreeman
Copy link
Contributor

@JamesFreeman JamesFreeman commented Oct 12, 2024

I've made some changes to Auth User store, do take into account that users may be authenticated by a different guard.

I've also wrote some docs for the new Credential Storages:
You can see a demo here:

https://jamesfreeman.github.io/laravel-xero-oauth2/credential-storage.html

@JamesFreeman JamesFreeman changed the base branch from master to develop October 12, 2024 20:33
@JamesFreeman JamesFreeman changed the title Document Credential Storages and Refactored Auth User Store to support different guards [6.x] Document Credential Storages and Refactored Auth User Store to support different guards Oct 12, 2024
@hailwood
Copy link
Contributor

hailwood commented Nov 4, 2024

This looks good to me.
One of the developers at work has been using the beta version and ran into an interesting scenario - they wanted a per user storage, but not directly on the user.

In this case it was - user belongs to organisation, so we want the organisations xero credentials.

I don't believe this is a case we're current covering right?

@JamesFreeman
Copy link
Contributor Author

Yeah, thinking this through at the moment, users would not be able to provide a dynamic model selection.

I was thinking as a potential solution, users could provide a callback on the useModelStore for selection.

Xero::useModelStore(Team::class, fn($builder) => $builder->where('id', Auth::user()->currentTeamId));

If you're happy with this pr, let's get it merged in, and I'll create a new task for this. 👍

@JamesFreeman
Copy link
Contributor Author

I've moved all code changes from this PR into #121 to make the AuthenicatedStore changes.

@JamesFreeman
Copy link
Contributor Author

Yeah, thinking this through at the moment, users would not be able to provide a dynamic model selection.

I was thinking as a potential solution, users could provide a callback on the useModelStore for selection.

Xero::useModelStore(Team::class, fn($builder) => $builder->where('id', Auth::user()->currentTeamId));

If you're happy with this pr, let's get it merged in, and I'll create a new task for this. 👍

Do you have any thoughts on this @hailwood?

@JamesFreeman
Copy link
Contributor Author

Hey @hailwood,

Have you had any thoughts on this PR and the comment above?

@hailwood hailwood merged commit 195a51e into webfox:develop Nov 27, 2024
10 checks passed
@JamesFreeman JamesFreeman deleted the chore/documentation-for-new-cms branch November 27, 2024 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants