-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
I found on some occasions, the Model being instantiated with the last request context, then I found this:
egg-oauth2-server/lib/server.js
Line 86 in 2d10b76
| this.ctx = ctx; |
You should never save ctx in application ever. This is my fix:
{
getServer(ctx) {
if (!ctx[SERVER]) {
const { config, model: Model } = this;
const model = new Model(ctx);
ctx[SERVER] = new AuthServer(Object.assign(config, { model }));
return ctx[SERVER];
}
return ctx[SERVER];
}
}Metadata
Metadata
Assignees
Labels
No labels