diff --git a/firstuseauthenticator/firstuseauthenticator.py b/firstuseauthenticator/firstuseauthenticator.py index 91c2572..7325c06 100644 --- a/firstuseauthenticator/firstuseauthenticator.py +++ b/firstuseauthenticator/firstuseauthenticator.py @@ -65,3 +65,12 @@ class FirstUseAuthenticator(Authenticator): else: db[username] = bcrypt.hashpw(password.encode(), bcrypt.gensalt()) return username + + def delete_user(self, user): + """ + When user is deleted, remove their entry from password db. + + This lets passwords be reset by deleting users. + """ + with dbm.open(self.dbm_path, 'c', 0o600) as db: + del db[user.name] diff --git a/setup.py b/setup.py index 2fb638a..a8500ff 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name='jupyterhub-firstuseauthenticator', - version='0.10', + version='0.11', description='JupyterHub Authenticator that lets users set passwords on first use', url='https://github.com/yuvipanda/jupyterhub-firstuseauthenticator', author='Yuvi Panda',