Skip to content
Snippets Groups Projects

Issue #2012976: Deprecate user_logout() and user_login_finalize() and replace with a service

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Kim Pepper added 4 commits

    added 4 commits

    • f74d33fa...1debb398 - 3 commits from branch project:11.x
    • 9a425a46 - Adds a UserSessionHandler and deprecates user_login_finalize() and user_logout()

    Compare with previous version

  • Kim Pepper added 1 commit

    added 1 commit

    Compare with previous version

  • Thanks for the feedback. Made suggested changes.

  • Kim Pepper resolved all threads

    resolved all threads

  • Kim Pepper added 1 commit

    added 1 commit

    Compare with previous version

  • Roderik Muit
  • Lauri Timmanee
  • Lauri Timmanee
  • Lauri Timmanee
  • Lauri Timmanee
  • Lauri Timmanee
  • Lauri Timmanee
  • Kim Pepper added 48 commits

    added 48 commits

    Compare with previous version

  • Kim Pepper resolved all threads

    resolved all threads

  • Kim Pepper added 121 commits

    added 121 commits

    Compare with previous version

  • Kim Pepper added 94 commits

    added 94 commits

    Compare with previous version

  • Kim Pepper added 340 commits

    added 340 commits

    Compare with previous version

  • Kim Pepper added 33 commits

    added 33 commits

    Compare with previous version

  • Kim Pepper added 1 commit

    added 1 commit

    • 8907cff9 - Remove UserSessionHandler interface

    Compare with previous version

  • added 1 commit

    • d0ae7827 - Replacing 10.2.0 with 10.3.0

    Compare with previous version

  • Lee Rowlands added 1 commit

    added 1 commit

    • 99eeeb10 - Update deprecation messages per suggestions

    Compare with previous version

  • Kim Pepper added 100 commits

    added 100 commits

    • 99eeeb10...16552b02 - 93 commits from branch project:11.x
    • 4d8b3221 - Adds a UserSessionHandler and deprecates user_login_finalize() and user_logout()
    • bc411d2f - Feedback fixes
    • 2327163c - Fix test
    • c00d7bc7 - Adds deprecation triggers and test
    • 492cca89 - Remove UserSessionHandler interface
    • a1a84c65 - Replacing 10.2.0 with 10.3.0
    • 1c8bb7fa - Update deprecation messages per suggestions

    Compare with previous version

  • Kim Pepper added 1 commit

    added 1 commit

    Compare with previous version

  • Kim Pepper resolved all threads

    resolved all threads

  • Thanks for the feedback. Made suggested changes.

  • Kim Pepper added 1 commit

    added 1 commit

    Compare with previous version

  • Kim Pepper added 33 commits

    added 33 commits

    Compare with previous version

  • Kim Pepper added 20 commits

    added 20 commits

    Compare with previous version

  • Kim Pepper added 79 commits

    added 79 commits

    Compare with previous version

  • Kim Pepper added 159 commits

    added 159 commits

    Compare with previous version

  • 63 $this->moduleHandler->invokeAll('user_login', [$user]);
    64 }
    65
    66 /**
    67 * Logs the current user out.
    68 */
    69 public function finalizeLogout(): void {
    70 $this->logger->info('Session closed for %name.', ['%name' => $this->accountProxy->getAccountName()]);
    71
    72 $this->moduleHandler->invokeAll('user_logout', [$this->accountProxy]);
    73
    74 // Destroy the current session, and reset $user to the anonymous user.
    75 // Note: In Symfony the session is intended to be destroyed with
    76 // Session::invalidate(). Regrettably this method is currently broken and
    77 // may lead to the creation of spurious session records in the database.
    78 // @see https://github.com/symfony/symfony/issues/12375
  • 284 284 filemime
    285 285 filesystems
    286 286 filetransfer
    287 finalizer
  • 22 * Creates a new UserSessionFinalizer.
    23 */
    24 public function __construct(
    25 protected AccountProxyInterface $accountProxy,
    26 protected RequestStack $requestStack,
    27 protected SessionManagerInterface $sessionManager,
    28 protected EntityTypeManagerInterface $entityTypeManager,
    29 protected ModuleHandlerInterface $moduleHandler,
    30 protected LoggerInterface $logger,
    31 protected TimeInterface $time,
    32 ) {}
    33
    34 /**
    35 * Finalizes the login process and logs in a user.
    36 *
    37 * The function logs in the user, records a watchdog message about the new
  • quietone
  • quietone added 21 commits

    added 21 commits

    Compare with previous version

  • catch @catch started a thread on the diff
  • 15
    16 /**
    17 * Finalize user sessions.
    18 */
    19 final class UserSessionFinalize {
    20
    21 /**
    22 * Creates a new UserSessionFinalize service.
    23 */
    24 public function __construct(
    25 protected AccountProxyInterface $accountProxy,
    26 protected RequestStack $requestStack,
    27 protected SessionManagerInterface $sessionManager,
    28 protected EntityTypeManagerInterface $entityTypeManager,
    29 protected ModuleHandlerInterface $moduleHandler,
    30 protected LoggerInterface $logger,
    • This should be a service closure - .e.g. we don't want to instantiate the logger and its own dependencies when someone just looks at the registration form.

    • Please register or sign in to reply
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading