mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-06-21 00:45:18 +00:00
Check the availability of Firebase before accepting new tokens
This commit is contained in:
@ -26,6 +26,10 @@ pub fn configure(r: &mut HttpRequestHandler) -> RequestResult {
|
||||
"disabled" => PushNotificationToken::NONE,
|
||||
|
||||
"firebase" => {
|
||||
if !r.api_client().is_firebase_available() {
|
||||
return r.bad_request("Firebase is unavailable!".to_string());
|
||||
}
|
||||
|
||||
PushNotificationToken::FIREBASE(r.post_string("firebase_token")?)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user