amberframework / amber

A Crystal web framework that makes building applications fast, simple, and enjoyable. Get started with quick prototyping, less bugs, and blazing fast performance.
https://amberframework.org
MIT License
2.57k stars 205 forks source link

Handle empty (auth) params #1264

Closed alliedarmour closed 1 year ago

alliedarmour commented 3 years ago

Description

Using the default generated Auth-Registration Controller, you get a 500 error if both fields are left blank. I thought this was fixed in #1085, but still happens for me.

Steps to Reproduce

  1. generate new amber app
  2. amber g auth User
  3. go to sign up page and leave the fields completely empty

Expected behavior: Error should be added to user.errors and shown to the user

Actual behavior: 500 error is thrown

Bildschirmfoto 2021-06-11 um 10 47 38

Reproduces how often: 100%

Versions

Crytal 1.0.0 Amber 0.36.0

alliedarmour commented 3 years ago

Update: Okay I found out that if you manually add true as 3rd parameter in validation it works. It should be written in the docs though :).