Move authentication to a separate filewq