diff --git a/src/Controller/PasswordlessController.php b/src/Controller/PasswordlessController.php
index 5f14e21..67314fd 100644
--- a/src/Controller/PasswordlessController.php
+++ b/src/Controller/PasswordlessController.php
@@ -54,14 +54,12 @@ class PasswordlessController extends ControllerBase {
    * @return array
    *   A simple renderable array.
    *
-   * @todo Find alternative to global $user.
    */
   public function sentPage() {
-    global $user;
     $http_referrer = check_url($_SERVER['HTTP_REFERER']);
 
     if (
-      !$user->hasPermission('configure passwordless settings') &&
+      !\Drupal::currentUser()->hasPermission('configure passwordless settings') &&
       $http_referrer != \Drupal::url('user.page', [], ['absolute' => TRUE]) &&
       $http_referrer != \Drupal::url('user.login', [], ['absolute' => TRUE])
     ) {
@@ -108,4 +106,4 @@ class PasswordlessController extends ControllerBase {
   public function getConfig() {
     return parent::config('passwordless.settings');
   }
-}
\ No newline at end of file
+}
