Casbin Forum runs on Casnode, the open-source Discourse-style forum. Try the Casnode demo →
Casbin Forum

Hello. Is there any way to include javascript on the signin and signup page?

I have migrated auth system from our internal one to casdoor but now there is a problem that email and name is case sensitive in casdoor.
Some ppl forgot what case was their email on registration but more important, mobile phones add first uppercase letter in the email field.
So ppl started to get errors and get irritated...

I'm trying to find any way to adjust this behaviour without modifying casdoor code. Any suggestions?

I have tried to replace postgres type from varchar to citext to make comparison case insensitive and that may work fine but it would cause error on casdoor restart when createTables run...

1views
2users
1 minread

Using JS will not work. The checks are done in the Go backend side

What you should do is letting your DBA modify the database's "user" table, change all "email" and "phone" column values to lowercase

it only takes 5 minutes with Datagrip and Excel

Thanks for your response!

But that doesn't solve the problem.
I can modify user table. Make emails and names lowercase directly. Add triggers to make sure everything will come lowercase.
But I can't ensure that when user would be logging in the field comparison would be case insensitive.

And it would be better to not modify or fork casdoor codebase to have less troubles later on updates.

Currently I have patched casdoor image and adding custom js file in the web/build/index.html that automatically loads my custom js.
Script in turn enforces lowercase in the fields and will do couple more beautifications for interface.
This way I can make sure that casdoor will register and later log in users properly.

Ofc it's in no way beautiful solution...

1 / 4
Apr 2025