Added local authorization using passport (based on an example from github).