fixed flash bug, must come after passport
moved config to server and refactored