public MainWindow()
        {
            InitializeComponent();

            PageNavigationManager.PageContentControl = contentControl;

            PageNavigationManager.SwitchToPage(new LoginPage());
        }
Exemplo n.º 2
0
        public static async Task LoginAs(AnonymProfileData data)
        {
            AuthData authData = new AuthData()
            {
                user     = data.login,
                password = "******" + data.id.ToString()
            };
            var response = await ApiHelper.RequestInternalJson <AuthResponse>("api/v1/login", authData, null);

            if (response.status == "success")
            {
                AppPersistent.Token = new AuthTokens()
                {
                    UserId = response.data.userId,
                    Token  = response.data.authToken
                };
            }
            PageNavigationManager.SwitchToPage(new RoomsPage());
        }