datamweb / shield-oauth

OAuth for CodeIgniter Shield
https://www.shield-oauth.codeigniter4.ir/
MIT License
61 stars 16 forks source link

Bug: ShieldOAuthModel not initializing parent #56

Closed clsmedia closed 1 year ago

clsmedia commented 1 year ago

PHP Version

8.1.23

CodeIgniter4 Version

4.4.1

Shield Version

dev-develop

Shield OAuth Version?

dev-main

Which operating systems have you tested for this bug?

macOS

Which server did you use?

apache

Database

mysql:latest

Did you add customize OAuth?

no, just Google

What happened?

On oauth/call-back i got an error: Typed property CodeIgniter\Shield\Models\BaseModel::$tables must not be accessed before initialization VENDORPATH/codeigniter4/shield/src/Models/UserModel.php at line 196

194 if ($email !== null) { 195 $data = $this->select( 196 sprintf('%1$s.*, %2$s.secret as email, %2$s.secret2 as password_hash', $this->table, $this->tables['identities']) 197 )

i think thats because $this->tables is null which - i believe - is because we're not initializing parent in ShieldOAuthModel

Steps to Reproduce

just regular setup according to repo guide

Expected Output

one should be logged in (or not)

Anything else?

No response

datamweb commented 1 year ago

Thanks for your report.

Please use branch develop.

composer require datamweb/shield-oauth:dev-develop
clsmedia commented 1 year ago

Thanks!