title: How I can intercept errors from passport strategies in nestjs?
body: <p>I created an auth module using nestjs and two passport strategies: passport-facebook, passport-google-oauth20. Everything works fine, except when it's not </p>
  <p>If there's an error in a passport strategy, the server return 500 error instead of a error thrown by a strategy. For example, if the token from identity provider been used already we got <em>FacebookTokenError: This authorization code has been used.</em> (passport-facebook) or <em>TokenError: Bad Request</em> (passport-google-oauth20) message in the console but server return 500 error.</p>
  <p>What is the nestjs way to return proper errors in that case?</p>
  <p>Also, can somebody explain why we need 2 routes (auth/google and auth/google/callback) when just one (auth/google with @UseGuards(AuthGuard('google'))) works fine?</p>