Node.js authentication implementation by me