nuxt-auth icon indicating copy to clipboard operation
nuxt-auth copied to clipboard

Implement functionality to parse getSession() response data efficiently

Open tnt-freskim-veliu opened this issue 1 year ago • 5 comments

Describe the feature

To simplify the process of obtaining the user object from the getSession() response, I would like to parse the JSON data directly from the request and retrieve the user object from the "data" property. Currently, I am required to store the entire response and extract the user object each time, which is inefficient.

My response json almost all the time is like this:

{ "data": {...user}, "status_code": 200, "message" : "Success", }

Additional information

No response

tnt-freskim-veliu avatar Apr 23 '23 09:04 tnt-freskim-veliu

Any idea how we should implement this?

One idea: We could give the option to also specify a jaon pointer to the actual session data, so that the right subfield will be extracted

BracketJohn avatar Apr 23 '23 10:04 BracketJohn

Yes, that would be a good idea.

tnt-freskim-veliu avatar Apr 25 '23 13:04 tnt-freskim-veliu

cc @Danielwinkelmann btw for more json-pointer use-cases!

BracketJohn avatar May 14 '23 10:05 BracketJohn

@BracketJohn I implement the feature in the new PR

Danielwinkelmann avatar May 14 '23 14:05 Danielwinkelmann

Hi @zoey-kaiser, why did you put this completed if it hasn't been merged for 6 months now and review is pending on the PR?

valh1996 avatar Nov 29 '23 19:11 valh1996

Closed via #592

phoenix-ru avatar May 16 '24 11:05 phoenix-ru