public LoggedInViewModel Init(AuthToken token, Action logout) { logoutCallback = logout; IsAdmin = token.IsAdmin(); NavigateToPage(PageName.ProductsList); return this; }
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; } }
public void ClearToken() { inMemoryToken = null; TryRemoveToken(); }