add verify_code function to user

You can change this if/else by:
`return db_code == code`