ddspringle / framework-one-secure-auth

An example fw/1 application with secure single and two-factor (2FA) authentication and session management functions
Apache License 2.0
31 stars 5 forks source link

Diagnose member function issue #2

Closed ddspringle closed 7 years ago

ddspringle commented 7 years ago

Found 'No matching Method/Function for Number.len() found' error on L112 and L223 ( arguments.value.len() ) when testing commit 2e240b8b6f3867d0913717560e88164708da56a9 w/ fw/1 4.0.0 on Lucee 5.1.0.34

Attempted rename of arguments.value to other names (arguments,input, arguments.data) to see if this was a naming issue, but error persisted.

Currently running same SecurityService in Lucee 4.5.4.017 using CB 4.3.0+188 w/o this issue.

Need to isolate if this is a Lucee 5.1.0.34 issue, a fw/1 4.0.0 issue, some combination of those two or something else entirely.

ddspringle commented 7 years ago

This issue does not occur with Lucee 5.1.0.34 and CB 4.3.0+188. So this seems to be isolated to fw/1 4.0.0 at this juncture.

@seancorfield may have further insights into why arguments.value.len() throws this error with fw/1 within the SecurityService.cfc

seancorfield commented 7 years ago

Lucee 5.x is not a supported platform for FW/1 at this point.

ddspringle commented 7 years ago

@seancorfield Heh, I thought you might say that. I was too tired to check it in 4.5 last night, but I just ran the same baseline commit through 4.5.4.017 and got the same error using variables.value.len()

However, attempting to build a simple test case using the same SecurityService logic doesn't throw the error at all, so... I'll have to do more hunting to figure out why it throws that error in this example code but not in the simple test case.

Thanks for the feedback... I'll keep you posted if I can reproduce in a simple test case. For now, len( variables.value ) works in the secure auth example so I'll stick with that ;)

ddspringle commented 7 years ago

@seancorfield I figured it out... it was me being dumb and not recognizing the input going into this function, which in this code is a number (whereas I'm normally working with guid's), and the error is exactly what it is - there is no len() method for the Number class in Lucee. Sadly, there's no LSIsNumeric() method either, so len( blah ) will just have to do. :)

seancorfield commented 7 years ago

One of those weird cases where in almost all circumstances CFML would happily treat a number as a string... except when you want it to! :)