public string Delete(string token) { if (_appSettings.Value.AdminKey.Equals(token)) { return(ReturnMessage.ErrorMessage("you can't delete the admin token!")); } else { TokenManager.DeleteToken(token); return(ReturnMessage.OkTokenMessage("token deleted", token)); } }
public UserContext Logoff(string userToken) { UserContext user = TokenManager.GetUser(userToken); if (user != null) { TokenManager.DeleteToken(userToken); } Action <string> afterLogoffHandler = this.AfterLogoffHandler; if (afterLogoffHandler != null) { afterLogoffHandler(userToken); } return(user); }
/// <summary> /// Destroys connection between this client and server and marks this socket as free (null) /// </summary> public void Disconnect(string disconnectReason = null) //todo send disconnect reason (todo by enum) { Log.WriteLine("Disconnected", this); //If i was in room i disconnect. //TODO wait for reconnect if it was not intentional if (this.IsInRoom) { //if client was in room then wait for him to return RoomManager.OnClientDisconnectedSuddenly(ConnectionId); } Session = null; ClientManager.Disconnect(ConnectionId); TokenManager.DeleteToken(AuthToken); }
public HttpResponseMessage SignOut() { TokenManager.DeleteToken(AccessToken); return(Success()); }
private void LogOutButton_OnClicked(object sender, EventArgs e) { TokenManager.DeleteToken(); Application.Current.MainPage = new LoginView(); }