예제 #1
0
 public LoggedInViewModel Init(AuthToken token, Action logout)
 {
     logoutCallback = logout;
     IsAdmin = token.IsAdmin();
     NavigateToPage(PageName.ProductsList);
     return this;
 }
예제 #2
0
 public void SaveToken(AuthToken token)
 {
     try
     {
         using (var store = GetStore())
         using (var file = store.OpenFile(TokenFileName, FileMode.Create))
         using (var writer = new StreamWriter(file))
         {
             var serializer = new JsonSerializer();
             serializer.Serialize(writer, token);
         }
     }
     catch (Exception e)
     {
         //logger.Log(e.Message, Category.Exception, Priority.None);
         inMemoryToken = token;
     }
 }
예제 #3
0
 public void ClearToken()
 {
     inMemoryToken = null;
     TryRemoveToken();
 }