Skip to content

Auth0User uses private variables so they cannot be accessed or overridden in child class #120

Closed
@cjd118

Description

@cjd118

Hi,

Auth0User declares $userInfo and $accessToken as private instead of protected.

This means our child class cannot override these values so we can't get getAuthIdentifier to return a different identifier (our use case being we don't want the locally stored user to have 'sub' as the column name and would prefer something more obvious like 'auth0_id' in the db users table).

e.g.

<?php

namespace Example\Users;

class ExampleUser extends \Auth0\Login\Auth0User
{
    public function getAuthIdentifier()
    {
		return $this->userInfo['auth0_id'];
    }
}

Is this something you can fix?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions