Fix issue where certain providers do not return the 'provider' field

Not all passport providers return `profile.provider` (notably OpenID). This causes an error when trying to authenticate against those providers i.e. `passport-google`.

Fixed the problem by using `query.provider` as a backup source when `profile.provider` is `undefined`.

Additionally, removed the unused `config` variable declaration.