You are here

public function LoginLogoutMenuLink::getRouteName in OAuth2 Login 8

Returns the route name, if available.

Return value

string The name of the route this menu link links to.

Overrides MenuLinkBase::getRouteName

File

src/Plugin/Menu/LoginLogoutMenuLink.php, line 70

Class

LoginLogoutMenuLink
A menu link that shows "Log in" or "Log out" as appropriate.

Namespace

Drupal\oauth2_login\Plugin\Menu

Code

public function getRouteName() {
  if ($this->currentUser
    ->isAuthenticated()) {
    return 'user.logout';
  }
  else {
    return 'oauth2_login.moLogin';
  }
}