Replit Database Error

Login Authentication using Replit Database

Repl link:

I’ve written a pet project of Login Authentication using Replit Database.
The code seem to be working fine on my end, but whenever I give my link to someone to test it., it hits them with an error when a user is registering for a new account, logging in as existing user, etc - basically render my code useless.

AttributeError: 'NoneType' object has no attribute 'keys'

Does it mean that the database is only visible and functional to the owner?
Why is anyone else getting the error?

I ran your code and got no errors. I did all three things.

Is it possible that the error only appears when a user is not logged in or does not have a replit account?
I logged out and tried my link, and i still see the error.

I see that now. When logged out of Replit I get the error, but not when logged in. Weird.

Traceback (most recent call last):
  File "", line 74, in <module>
    NewUser() #new user registration
  File "", line 11, in NewUser
    keys=db.keys() #accessing database list
AttributeError: 'NoneType' object has no attribute 'keys'

It appears that the db cannot be accessed while logged out of Replit (hence the error). You could hard code the URL, but that would be a security risk.


Makes total sense. Thanks for the tip and reminder of the risk. I’ll find some other ways. Thanks heaps!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.