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

mounted app.keys ignored #29

Open
idiomatic opened this issue Aug 21, 2015 · 0 comments
Open

mounted app.keys ignored #29

idiomatic opened this issue Aug 21, 2015 · 0 comments

Comments

@idiomatic
Copy link

per @vinerz on koajs/koa#203:

... I want to set a isolated session path on /connect because this the only place I will use sessions, my app is a stateless API but I have to use sessions for Grant (Facebook & Twitter Sign-in). I don't want to share my API v1 keys with all other endpoints of the server.

var app = koa();

// first session handler
var connect = koa();
connect.keys = ['awesome-key'];
connect.use(session({
    store: redisStore()
}));

app.use(mount('/connect', connect));

// second session handler
var connect2 = koa();
connect2.keys = ['other-key'];
connect2.use(session({
    store: redisStore()
}));

app.use(mount('/connect2', connect2));

If both the parent app and mounted app have dissimilar keys arrays, the context may need a keys-merged keygrip instantiated upon mount descent.

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

No branches or pull requests

1 participant