Authentication For Dummies (Er, Dummy)

chaoticset on 2002-06-30T17:46:27

I threw a barebones email address verification in until I can find the one in the Mouse (I think I just did, chapter nine, 219-220) that's more inclusive. Mine is just /\w*@\w*.\w*/, which I realize is hideously short-sighted. I'm erring on the side of being too restrictive. (That is the idea with security-conscious programming, right? If you have a choice, err on the side of being too restrictive.)

User addition and authentication no longer looks insurmountably inscrutable. I may even be able to get that searchy thing working, too.


broken?

gav on 2002-06-30T18:39:06

/\w*@\w*.\w*/ is broken as it won't match a lot of valid emails and will match some garbage :)

You should look at Email::Valid and/or use something like /^\S+\@\S+\.\S+$/ and check for valid emails by sending one containing some kind of auth code.

Re:broken?

chaoticset on 2002-06-30T19:43:30

I knew it wouldn't match a lot of emails, but didn't realize until just now when you pointed it out that it would match invalid emails too. :\ Good thing this isn't production, I guess...

I hadn't settled on anything yet; I want to grok the validation sub in the Mouse and check some other options before I decide on anything. (Whatever it is, I want to make sure it's fairly airtight. I'd like to impress Mike with this if it's at all possible.)