accounts-js / rest Goto Github PK
View Code? Open in Web Editor NEWREST transport for accounts.
Home Page: https://accounts-js.netlify.com/docs/transport/rest/
License: MIT License
REST transport for accounts.
Home Page: https://accounts-js.netlify.com/docs/transport/rest/
License: MIT License
We've used the rest client on it's own on various occasions. There is no reason accounts/client
will be a peer dependency.
Hi! I need, for my project to use cookie based token storage.
Indeed, I want to be able to authenticate the user in the first request, so I can achieve SSR with restricted data.
How do you recommand to edit the rest API in order to do so?
I was thinking about turning this :
res.json(objectContainingTokens)
into this :
res.Cookie('access-token', tokens.accessToken, {httpOnly:true, secure:true, maxAge:172800} )
res.Cookie('refresh-token', tokens.refreshToken, {httpOnly:true, secure:true, maxAge:1296000000} )
res.json(objectWithoutTokens)
Which other package will I need To edit?
Thank you
In one of the alphas we use, the OAuth provider is a bit different from the current.
There is a code that exposes the OAuth access token using a the req.session.grant.response.access_token
and then the provider can verify it.
I tried to update to the latest beta (2) now, but my OAuth provider does not get the accessToken (in authenticate
callback).
Maybe we need to allow the developer to expose a custom method that transforms req
to params
?
Or maybe we can expose the session
from req
here?
The current implementation only returns an object like this:
{
"message": "User not found"
}
This is not really nice to process, since there's no easy way to identify what went wrong. An error-code would be good.
{
"errorCode": "userNotFound",
"message": "The User requested was not found"
}
For resource user
getUser
to GET - user
createUser
to POST - user
For resource session
loginWithPassword
to POST login
refreshTokens
to UPDATE session
/tokens
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.