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

Option dontKeepLogOf being ignored? #20

Closed
swimlappy opened this issue Dec 9, 2015 · 7 comments
Closed

Option dontKeepLogOf being ignored? #20

swimlappy opened this issue Dec 9, 2015 · 7 comments

Comments

@swimlappy
Copy link

Hello,

I implemented this package in a project of mine. Very nice, easy to setup and worked right away. Good stuff!

I noticed that it was logging the password field when I was creating a user, so I added that field to the dontKeepLogOf config option. I still see that field showing up in the logs. I tried this option on other models and the same behavior is there, it still writes to the log any field I ask it to ignore. Here is my User model for reference, what might I be missing?

namespace app;

use Illuminate\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Foundation\Auth\Access\Authorizable;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
use Cviebrock\EloquentSluggable\SluggableInterface;
use Cviebrock\EloquentSluggable\SluggableTrait;
use Silber\Bouncer\Database\HasRolesAndAbilities;
use OwenIt\Auditing\AuditingTrait;

class User extends Model implements AuthenticatableContract,
                                    AuthorizableContract,
                                    CanResetPasswordContract,
                                    SluggableInterface
{
    use Authenticatable, Authorizable, CanResetPassword, SluggableTrait, HasRolesAndAbilities, AuditingTrait;

    /**
     * Fields we DON'T want to register with auditing.
     */
    protected $dontKeepLogOf = ['password', 'remember_token'];

    /**
     * The database table used by the model.
     *
     * @var string
     */
    protected $table = 'users';

Do you have any suggestions as to what I might be doing incorrectly? I am running Laravel Framework version 5.1.26 (LTS) and in my composer.json, I've required "owen-it/laravel-auditing": "^2.1".

Thanks!

@anteriovieira
Copy link
Member

Hello my friend, thank you for your contribution. It was not your fault, but already corrected and took advantage to make some improvements.

The current version is v2.1.5, use composer update owen-it/laravel-auditing to upgrade your version. Thanks for being part of this team, anything can call here.

@swimlappy
Copy link
Author

Ah, that did work, sort of. I upgraded from v2.1.4 to v2.1.5 and when I create a new user, the password field is no longer showing up in the log. However, I deleted that user as a test and the log entry does show the password field. Should that field be ignored for all operations?

@anteriovieira
Copy link
Member

When removing the User, the skipped fields should not appear, this is what is happening?

@swimlappy
Copy link
Author

Yes that is correct. It appears when I remove the user. The original issue of it appearing when the user is added has been fixed..

@anteriovieira anteriovieira reopened this Dec 10, 2015
@anteriovieira
Copy link
Member

@swimlappy you can test the version 2.1.6?

@swimlappy
Copy link
Author

It is working now, thanks for the quick fix!

@anteriovieira
Copy link
Member

I thank you for your help.

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

No branches or pull requests

2 participants