Class: AuthGithubController
Github controller
Flow of how github works:
- Client call auth/github/login to be redirected to github login page to require authentication
- After authorized by github, the user will be redirected to the callback url defined in the config
- The auth/github/callback url will be called with the code as a query parameter
- The code will be used to get the access token and user profile from github
- The user profile will be used to create a new user or return the existing user from federated module
- The user will be authenticated and a token will be issued
- The token will be returned to the client
- The client can use the token to make requests to the protected resources
Constructors
new AuthGithubController()
new AuthGithubController(
issueTokenService
):AuthGithubController
Parameters
Parameter | Type |
---|---|
issueTokenService | IssueTokenServiceInterface |
Returns
Defined in
packages/nestjs-auth-github/src/auth-github.controller.ts:37 (opens in a new tab)
Methods
get()
get(
user
):Promise
<AuthenticationResponseInterface
>
Parameters
Parameter | Type |
---|---|
user | AuthenticatedUserInterface |
Returns
Promise
<AuthenticationResponseInterface
>
Defined in
packages/nestjs-auth-github/src/auth-github.controller.ts:60 (opens in a new tab)
login()
login():
void
Login
Returns
void
Defined in
packages/nestjs-auth-github/src/auth-github.controller.ts:49 (opens in a new tab)