From 1ec31c6899fd9ec6d86738986c75720ec490880f Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 28 Aug 2018 08:41:11 -0400 Subject: [PATCH] add support for log out notification --- src/App/Enums/PushType.cs | 4 +++- src/App/Services/PushNotificationListener.cs | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/App/Enums/PushType.cs b/src/App/Enums/PushType.cs index 6a697dba7..786c25078 100644 --- a/src/App/Enums/PushType.cs +++ b/src/App/Enums/PushType.cs @@ -13,6 +13,8 @@ SyncFolderCreate = 7, SyncFolderUpdate = 8, SyncCipherDelete = 9, - SyncSettings = 10 + SyncSettings = 10, + + LogOut = 11, } } diff --git a/src/App/Services/PushNotificationListener.cs b/src/App/Services/PushNotificationListener.cs index ba40a5074..f313bb912 100644 --- a/src/App/Services/PushNotificationListener.cs +++ b/src/App/Services/PushNotificationListener.cs @@ -147,6 +147,13 @@ namespace Bit.App.Services } _syncService.SyncProfileAsync(); break; + case Enums.PushType.LogOut: + var logOutMessage = JsonConvert.DeserializeObject(data.Payload); + if(logOutMessage.UserId == _authService.UserId) + { + _authService.LogOut(null); + } + break; default: break; }