Fallback to anonymous user if no default user is set

Created on 3 November 2023, about 1 year ago
Updated 6 November 2023, about 1 year ago

Problem/Motivation

\Drupal\simple_oauth\Grant\ClientCredentialsOverrideGrant::getDefaultUser returns null if there is no user, or if the `target_id` is `0`.

Can simple_oauth allow anonymous users as the default user?

    return $client_drupal_entity
      ? $client_drupal_entity->get('user_id')->target_id
      : NULL;

This check fails because of `0` and not an explicit `null` check

if (!$this->getDefaultUser($client)) {

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Fixed

Version

5.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mglaman WI, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024