You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Setting a cookie is not something that koa-jwt has in its remit. Its quite simple to do without any libraries though:
// somewhere inside a koa middleware function:constjwt='blah:blah:blah';// if this is the JWT that you want to set as a cookieconstcookieOptions={// see here for options:// https://koajs.com/#ctx-cookies-set-name-value-options-};// COOKIE_NAME should match `opts.cookie` that is passed to koa-jwt,// if koa-jwt is authenticating against the cookie that you want to setctx.cookies.set(COOKIE_NAME,jwt,options);
Does anyone knows how to store JWT token in a cookie with koa-jwt?
The text was updated successfully, but these errors were encountered: