Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Feature/login history #340

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

tnramalho
Copy link
Collaborator

No description provided.

@tnramalho tnramalho requested a review from MrMaz January 18, 2025 16:11
@tnramalho tnramalho changed the title Feature/login history WIP: Feature/login history Jan 18, 2025
* main:
  chore: bump root package version
  v6.0.0-alpha.1
  fix: crud builder swagger decorator improvements

Conflicts:
	packages/nestjs-auth-apple/package.json
	packages/nestjs-auth-github/package.json
	packages/nestjs-auth-google/package.json
	packages/nestjs-auth-local/package.json
	yarn.lock
* main:
  fix: revert deleted code comment about security
  chore: update default logo path
  chore: linting
  chore: add active for missing classes
  chore: linting
  chore: add logo to all email itemplates
  chore: add logo to templates
  chore: add option to overwrite rate limit for invitation and recovery
  chore: add otp status and limit validation
  chore: new package proposal
  chore: template for feature requests
* main:
  feat: move event manager options to contructor
  feat: fix tsdoc type
  feat: implement event manager on dependent modules
  feat: add event manager
@MrMaz
Copy link
Collaborator

MrMaz commented Feb 4, 2025

I feel like we should be doing the logging in the strategy instead of the controller. Just in general I want to avoid doing logic in the controller whenever possible.

You can get the req in the strategy callback with the passReqToCallback option. See the last section of: https://www.passportjs.org/concepts/delegated-authorization/

@tnramalho
Copy link
Collaborator Author

What if we get an error after the strategy? at the time to generate the payload with access token?

@MrMaz
Copy link
Collaborator

MrMaz commented Feb 4, 2025

What if we get an error after the strategy? at the time to generate the payload with access token?

I think this is two different things.

  1. User is authenticated successfully.
  2. User is issued token.

We have an outstanding TODO item related to emitting an event when the token is issued.

@tnramalho
Copy link
Collaborator Author

in that case i believe it make sense to do on strategy, i will make the changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants