Use NOT isAnonymous rather than isAuthenticated for checking accounts are not the anonymous user

Created on 18 August 2020, almost 4 years ago
Updated 7 April 2023, about 1 year ago

Problem/Motivation

PaymentOptionsBuilder gets the order's customer and then, if the customer isAuthenticated() will show the stored options for that customer. Whilst in core, isAuthenticated() is a direct opposite of isAnonymous(), it's possible to override the user entity class and make modifications to that for other purposes (in our case we have a CRM, so we have users stored that are not anonymous, but also have no login credentials, so are not authenticated).

There are also a bunch of other places, such as payment gateways, profiles, receipts etc that do the same.

Proposed resolution

Switch to checking !isAnonymous() where we are trying to identify accounts that are not the anonymous user.

📌 Task
Status

Fixed

Version

2.0

Component

Payment

Created by

🇬🇧United Kingdom andrewbelcher

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024