Require email for Kirby v2 user

Hello, This is regarding Kirby v2. Is it possible to require the email field? Please advise.

I don’t think so, at least not without modifying the source code.

You could, however, create a custom login form then redirect to the Panel.

Keep in mind that Kirby 2 reaches EOL at the end of this year.

Thanks. Hmmm. Guess it wouldn’t hurt to find and tweak the one field being that v2 will not receive updates. Any guidance on where the heck that file would be?

Hm, according to this file, the email field is actually required? https://github.com/getkirby-v2/panel/blob/master/app/forms/installation/signup.php

Haven’t worked with Kirby 2 in a long while…

Or do you want the user to be able to log in with email instead of username?

Login form definition is here: https://github.com/getkirby-v2/panel/blob/master/app/forms/auth/login.php

But to login with email instead of username, you probably have to change the logic somewhere.

1 Like

Thanks for the additional info @texnixe . I’m just looking to require the email, nothing more and I can see that the email field is not required. Hmm.

Upon further investigation I see Kirby v2 must use the following file to determine those signup fields.

panel/app/forms/users/user.php

I tweaked that file to the following. We’re all good now.

  $fields['email'] = array(
    'label'         => 'users.form.email.label',
    'type'          => 'email',
    'required'      => true,
    'autocomplete'  => false,
  );

I hope that’s helpful to any of those folks out there still working on some of those old Kirby builds.