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

feat: add a json pointer for the session object #392

Conversation

Danielwinkelmann
Copy link
Contributor

Closes #350 .

add a json pointer for the session object.

Checklist:

  • issue number linked above after pound (#)
  • manually checked my feature (playground-local)
  • testing not applicable (playground-local)
  • screenshot not applicable

* @default / Access the root of the session response object
* @example /data/user Access the `data/user` property of the session response object
*/
sessionDataResponseTokenPointer?: string
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can move this and the sessionDataType into the SessionConfig and then use it for all providers, right?

Defaults would just need to be slightly different per provider:

Tghis would be nice as it would unify behavior of all providers + make it way easier to type the return of the authjs provider (which was a big pain before). What do you think?

@phoenixgao
Copy link

is this going to be merged?

@zoey-kaiser
Copy link
Member

is this going to be merged?

I would like to see that the review of @BracketJohn is addressed before moving on!

@valh1996
Copy link
Contributor

valh1996 commented Nov 29, 2023

Hi @Danielwinkelmann,

6 months have passed, have you had a chance to look at the @BracketJohn review please?

I think we really need to merge it.

@zoey-kaiser
Copy link
Member

Hi @valh1996 👋

You are welcome to also fork this PR and make the required changes! We can then look into merging this soon!

@zoey-kaiser
Copy link
Member

Closed in favour of #592

@zoey-kaiser zoey-kaiser closed this Dec 4, 2023
phoenix-ru added a commit that referenced this pull request May 16, 2024
…onConfig (#592)

* feat: add generic to "jsonPointerGet"

* feat: implement the sessionDataJsonPointer

* feat: add to docs

* feat: move pointer and sessionDataType to the SessionConfig

* fix: remove default baseUrl

* fix merge conflicts from main

* fix: merge conflict with SessionConfig

* reset to main branch state

* fix: lint

* feat: make session refresh params optional

* feat: rebase `jsonPointerGet` function on @Danielwinkelmann's original modifications

* refacto: set the return type when extracting json pointers

* fix: should use the pointer to retrieve the user session not datatype + improves returned error

* revert: import as type

* fix lint

* fix: type issue - forgotten changes from daniel

* move the session data type back to the providers (local and refresh)

* forget to remove baseurl while testing

* fix: use config directly

* docs: add session data type to the refresh docs

* fix(playground): reset to default pointer '/'

Co-authored-by: Marsel Shayhin <[email protected]>

* Update useAuth.ts

* Update useAuth.ts

* Update helpers.ts

* Update helpers.ts

* fix: usage of `/` in json pointer get

---------

Co-authored-by: Daniel Winkelmann <[email protected]>
Co-authored-by: Daniel <[email protected]>
Co-authored-by: Zoey <[email protected]>
Co-authored-by: Valentin Hutter <[email protected]>
Co-authored-by: Valentin Hutter <[email protected]>
Co-authored-by: Marsel Shayhin <[email protected]>
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.

Implement functionality to parse getSession() response data efficiently
5 participants