Finished implementing auth generation and checking for the db script.

Hopefully.