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

Key should never be @undefined #59

Open
christianbundy opened this issue Aug 12, 2020 · 3 comments
Open

Key should never be @undefined #59

christianbundy opened this issue Aug 12, 2020 · 3 comments

Comments

@christianbundy
Copy link
Contributor

christianbundy commented Aug 12, 2020

const crypto = require("crypto");
const secretStack = require("secret-stack");

const appKey = crypto.randomBytes(32).toString("base64");

const stack = secretStack({ appKey });

const app = stack();

console.log(app.id); // => "@undefined"
@staltz
Copy link
Member

staltz commented Sep 11, 2020

Note to self:

We should require (TS) config.keys and/or emit a (JS) warning when it's missing.

@austinfrey
Copy link

I took a swing at this based on your note @staltz , #67. A new error is logged when no keys are passed in along with the config and updated the Config type in types.d.ts. Not sure how I feel about the log since it's going to make a lot of tests throughout the ecosystem very noisy. Thoughts?

@staltz
Copy link
Member

staltz commented Dec 21, 2020

@austinfrey Thanks for the PR! :)
What mix said over there is what I would say too

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

3 participants