Пример #1
0
        public AuthResponse <string> Login(string password)
        {
            string    token     = _WebServer.CreateToken(password);
            AuthState authState = _WebServer.Login(Context.ConnectionId, token);

            if (authState == AuthState.Authenticated)
            {
                Groups.Add(Context.ConnectionId, GROUP_AUTHED);
                return(AuthResponse <string> .Authenticated(token));
            }
            Groups.Remove(Context.ConnectionId, GROUP_AUTHED);
            return(AuthResponse <string> .NotAuthenticated(authState));
        }