Allow no notification address or type #197
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Normally a client sends the notificationAddress and notificationType parameters with each registration and authentication response as HTTP POST parameters. In some situations however a tiqr client can not get a notification address. Different clients respond (and have responded) differently to this situation. The notificationAddress and notificationType parameters may be absent, or both or only notificationAddress maybe set to the string "(null)" or "NULL". This leads to several issues that this PR addresses:
Currently there are user entries in the user storage table that have notificationAddress set to '(null)' or 'NULL'. Stepup-tiqr tries to send a push notification to these addresses, and that leads to an error. We change this behaviour so that NULL or (null) means no push address / type so no notification is send. We explicitly log this situation.
When a client omits a notificationAddress or notificationType this currently leads to an exception and the registration will fail. We change this behaviour so that this is accepted and allow the registration and authentication to continue.