Update 'lib/oauth2.js'

When a user succesfully authenticate himself, he is redirected from where he clicks the login link.
Add test for the redirect feature.
Merge branch 'develop'