Skip to content

Create the 'yiisoft/auth-session' package to replace the 'yiisoft/user' package #137

Description

@klsoft-web

The 'user' term is more relevant to a package that implements the Yiisoft\Auth\IdentityInterface interface, whereas the yiisoft/user package implements various authentication methods via the session:

  • The authenticate(ServerRequestInterface $request) method checks if an identity ID is saved in the session.
  • The login(IdentityInterface $identity) method sets an identity ID in the session.
  • The logout() method removes an identity ID from the session.
    And so on.

The names 'ApiAuth' and 'WebAuth' do not have to be related to the API or web application.
The AuthenticatorInterface is a universal interface for any application that uses sessions.

As the 'yiisoft/user' package contains many misleading names, including its own, the following names were suggested for the new package:

  • 'yiisoft/auth-session' instead of 'yiisoft/user'
  • AuthManager instead of CurrentUser
  • Authenticator instead of ApiAuth and WebAuth

The AuthManager method names are:

  • isAuthenticated() instead of isGuest()

Originally posted by @klsoft-web in yiisoft/docs#514

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions