Coder Social home page Coder Social logo

Comments (9)

Bubka avatar Bubka commented on June 2, 2024

Hi,

what db are you using?
I can't reproduce using mysql.

edit: also tested with sqlite, can't reproduce either

from 2fauth.

Bubka avatar Bubka commented on June 2, 2024

Can you please confirm you have this line in log files (see /2fauth/storage/logs/*.log:

User ID #x cannot view twofaccount ID #y

from 2fauth.

doctor-beat avatar doctor-beat commented on June 2, 2024

Hi,

  1. we are on mysql, both columns in db are in fact integer types
  2. php 8.2
  3. yes those are in the logs and are what triggered me to locate the issue:

[2024-03-12 16:38:55] production.NOTICE: User isOwner of with ID #integer vs twofaccount ID #string: [2024-03-12 16:38:55] production.NOTICE: User ID #3 cannot view twofaccount ID #3 [2024-03-12 16:40:45] production.NOTICE: User isOwner of with ID #integer vs twofaccount ID #string:

I have added an extra line of logging for personal debugging

from 2fauth.

Bubka avatar Bubka commented on June 2, 2024

Ok, thx for the env setup.
Iยดm going to make more testing, I would like to understand why types are not consistent from one setup to another ๐Ÿค”

from 2fauth.

doctor-beat avatar doctor-beat commented on June 2, 2024

yes, thanks. I i can be of any help let me know. I am a java//php dev as well.

from 2fauth.

Bubka avatar Bubka commented on June 2, 2024

Well, I cannot reproduce, even with the exact same setup. What page do you load while debugging the trait?

from 2fauth.

Bubka avatar Bubka commented on June 2, 2024

Could you please try this fix for me ?

Edit 2fauth_install_dir/app/Models/TwoFAccount.php.
Line 148, set the $casts like this:

    protected $casts = [
        'user_id' => 'integer',
    ];

Thx

from 2fauth.

doctor-beat avatar doctor-beat commented on June 2, 2024

That fixes the issue, triple equality is now comparing two integers

from 2fauth.

Bubka avatar Bubka commented on June 2, 2024

Ok thanks ๐Ÿ‘๐Ÿป

from 2fauth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.