Updated code to fix 500 error related to OAUTH redirection for first time users.
Updated.