Near the top of the scaffolding application, it said:
db = DAL('sqlite://storage.sqlite')
Near the bottom of the application i had copied from my old
application the following:
db = SQLDB('sqlite://db.db')
So the variable db was used twice to indicate different tables.
I have no idea now how authentication could ever work like that...

