Fixing session and oauth flow