Add a check for the secret in authenticate