Skip to content

Conversation

@JamesFreeman
Copy link
Collaborator

@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
Collaborator 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
Collaborator Author

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

@JamesFreeman
Copy link
Collaborator 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
Collaborator Author

Hey @hailwood,

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

@hailwood hailwood merged commit 195a51e into foxbytehq: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