Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Shield adding alternate fields
#1

(This post was last modified: 11-25-2022, 10:39 AM by superior.)

Hi,

It's the first project for me using the Shield Auth library, must say it's pretty clear and easy to use. The only issue i'm having right now is the 'personalFields' that's being used for registrations for example, this also checks against the 'NothingPersonalValidator' so it's pretty strict in chosing the password for users. Do we have an alternative way to allow more columns without messing with the core, for example an alternative array like 'userColumns' that's merged into to Model/Entity so you don't have to modify that much.

If it's unclear let me know, explaining things isn't my best quality.

EDIT:
Fixed using: https://github.com/codeigniter4/shield/pull/491
Reply
#2

please see https://github.com/codeigniter4/shield/b...validators
Reply
#3

(This post was last modified: 11-09-2022, 01:15 AM by superior.)

(11-08-2022, 09:06 AM)datamweb Wrote: please see https://github.com/codeigniter4/shield/b...validators

Thank you for the reply!
This confirms what i'm thinking and have read.
I want to exclude some fields from this list and keep it separated so it doesn't compromise the security but is able to use more fields.
So a different array with default columns (created my own with migration) and when needed add some fields to the check against 'NothingPersonalValidator' inside the 'personalFields'.

Basicly something like
PHP Code:
<?php

// Check against these columns in 'users' table
public array $personalFields = ['firstname''lastname''company'];

// All custom columns in 'users' table
public array $userColumns = ['firstname''lastname''company''address''zipcode''city''country''phone''newsletter']; 
Reply




Theme © iAndrew 2016 - Forum software by © MyBB