added env checks in oauth initializer