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 <18054980+phoenix-ru@users.noreply.github.com>

* Update useAuth.ts

* Update useAuth.ts

* Update helpers.ts

* Update helpers.ts

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

---------

Co-authored-by: Daniel Winkelmann <dwinkelmann@outlook.com>
Co-authored-by: Daniel <74846767+Danielwinkelmann@users.noreply.github.com>
Co-authored-by: Zoey <zoeykaiser8@gmail.com>
Co-authored-by: Valentin Hutter <valentin@macbook-pro-de-valentin.home>
Co-authored-by: Valentin Hutter <valentin@MacBook-Pro-de-Valentin.local>
Co-authored-by: Marsel Shayhin <18054980+phoenix-ru@users.noreply.github.com>
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