Module: router/google

Requires

Methods

(inner) auth/google(req, res)

Sends users to the oauth consent screen
Parameters:
Name Type Description
req request
res response redirects user
Author:
  • Tyler Del Rosario
Source:

(inner) auth/google/callback_controller()

Receives user's google data and pushes it to module:controller/google.
Author:
  • Tyler Del Rosario
Source:

(inner) auth/google/callback_data(req, res, next)

Receives access token, sends it to module:oauth/google_data_client and retrieves user's google profile data.
Parameters:
Name Type Description
req request Should contain a JSON object containing the access_token.
res response Should redirect back to homepage with error if any errors are thrown.
next function If the data retrieval from module:oauth/google_data_client is successful, push the users data to the controller.
Author:
  • Tyler Del Rosario
Source:

(inner) auth/google/callback_token(req, res, next)

Receives authorization code from the user accepting google oauth and pushes the code into module:oauth/google_token_client to retrieve an access token.
Parameters:
Name Type Description
req request Should contain an authorization code to be passed onto module:oauth/google_token_client
res response If user denied authorization, redirect them back to home page with an error.
next function If the retrieval of an access_token from module:oauth/google_token_client is successful, push the token into the next router module.
Author:
  • Tyler Del Rosario
Source: