Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(partners): Fix Laravel 11 Compatibility: Implement getAuthPasswordName() Method in OAuthUser Model #34

Closed
wants to merge 1 commit into from

Conversation

salzebari
Copy link
Contributor

Overview

This PR addresses compatibility issues with Laravel 11 for the oauth2-merchant package by implementing the getAuthPasswordName() method in the OAuthUser model.

Problem

In Laravel 11, the Authenticatable contract introduces a new method getAuthPasswordName(). Models implementing this contract must provide an implementation of this method.

Solution

We've added an implementation of getAuthPasswordName() to the OAuthUser model that throws a BadMethodCallException when invoked, since OAuth users do not have a traditional password:

public function getAuthPasswordName()
{
    throw new \BadMethodCallException('Not available for OAuth users');
}

Changes

  • Implemented getAuthPasswordName() method in OAuthUser model
  • Added test coverage for the new method implementation

Reference

This change is based on the Laravel framework update: Laravel Framework PR #48665

@SallaDev SallaDev marked this pull request as draft December 17, 2024 15:18
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.11% (target: -0.10%) 100.00% (target: 80.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (45eb944) 99 88 88.89%
Head commit (590d736) 100 (+1) 89 (+1) 89.00% (+0.11%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#34) 1 1 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

@salzebari
Copy link
Contributor Author

Wrong branch name

@salzebari salzebari closed this Dec 17, 2024
@salzebari salzebari deleted the fix/DPD-6078-fix-error-in-laravel-11 branch December 17, 2024 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant