You can conditionally set your UI elements to be visible depending on the result of your login call, so for example:
self.my_ui_element.visible = False
anvil.microsoft.auth.login()
if anvil.microsoft.auth.get_user_email() is not None:
self.my_ui_element.visible = True
This will then only show elements of your Form if the user has successfully logged in, and will not show them if they dismiss the alert.
However, it’s worth mentioning that anything in your client code is potentially accessible to the user (and therefore potentially manipulable by them), so you’ll still want to make sure that you perform any security checks on the server before running any restricted actions. See the docs here: