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

Fix create-admin route #218

Closed

Conversation

ripper234
Copy link
Contributor

/dev/create-admin is faulty, tries to do res.redirect twice, both inside and outside the promise, causing the following error, which this PR fixes:

        {"isFulfilled":false,"isRejected":true,"rejectionReason":{"message":"Can't set headers after they are sent.","stack":"Error: Can't set headers after they are sent.
    at ServerResponse.setHeader (_http_outgoing.js:367:11)
    at ServerResponse.header (C:\\work\\midburn\\Spark\\node_modules\\express\\lib\\response.js:718:10)
    at ServerResponse.location (C:\\work\\midburn\\Spark\\node_modules\\express\\lib\\response.js:835:8)
    at ServerResponse.redirect (C:\\work\\midburn\\Spark\\node_modules\\express\\lib\\response.js:874:8)
    at Child.<anonymous> (C:\\work\\midburn\\Spark\\routes\\dev_routes.js:24:13)
    at Child.tryCatcher (C:\\work\\midburn\\Spark\\node_modules\\bookshelf\\node_modules\\bluebird\\js\\release\\util.js:16:23)
    at Promise._settlePromiseFromHandler (C:\\work\\midburn\\Spark\\node_modules\\bookshelf\\node_modules\\bluebird\\js\\release\\promise.js:510:31)
    at Promise._settlePromise (C:\\work\\midburn\\Spark\\node_modules\\bookshelf\\node_modules\\bluebird\\js\\release\\promise.js:567:18)
    at Promise._settlePromise0 (C:\\work\\midburn\\Spark\\node_modules\\bookshelf\\node_modules\\bluebird\\js\\release\\promise.js:612:10)
    at Promise._settlePromises (C:\\work\\midburn\\Spark\\node_modules\\bookshelf\\node_modules\\bluebird\\js\\release\\promise.js:691:18)
    at Async._drainQueue (C:\\work\\midburn\\Spark\\node_modules\\bookshelf\\node_modules\\bluebird\\js\\release\\async.js:133:16)
    at Async._drainQueues (C:\\work\\midburn\\Spark\\node_modules\\bookshelf\\node_modules\\bluebird\\js\\release\\async.js:143:10)
    at Immediate.Async.drainQueues (C:\\work\\midburn\\Spark\\node_modules\\bookshelf\\node_modules\\bluebird\\js\\release\\async.js:17:14)
    at runCallback (timers.js:651:20)
    at tryOnImmediate (timers.js:624:5)
    at processImmediate [as _immediateCallback] (timers.js:596:5)"}}

@asihud
Copy link
Contributor

asihud commented Apr 8, 2017

this is not needed anymore, as we are not using local users anymore.

@asihud asihud closed this Apr 8, 2017
@ripper234
Copy link
Contributor Author

No problem. Then, the code for that component should be removed.

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

Successfully merging this pull request may close these issues.

2 participants