oauthclient: authorize url fix

* Changes authorize url to redirect to login form instead of register.
  (closes #2487)

* Moves imports inside functions.