How to disable token if password defined

Hello there,

I’m setting up an image of a Jupyter notebook server, and have defined a default token for accessing the notebook, via the config file parameter:
c.NotebookApp.token = ‘default’

The idea is that users of the image use the token to define a password by only having access to the web interface. It works to the extent that one can give a password, and then subsequently login using that password.

The problem is, that one can still always log in with the default token. Is there a way to define that if a password is set, the defined token should not be used?

Cheers,
Mikael