Esempio n. 1
0
        async public override Task AuthenticateAsync(string email, string password)
        {
            // Always authenticate successfully, but make them wait
            await Task.Delay(DELAY_TIME);

            // Some very sketchy student who goes to two schools.
            Model.Org org1 = new Model.Org(1, "Locust Valley High School");
            Model.Org org2 = new Model.Org(2, "Oyster Bay High School");

            CurUser = new Model.User(1, "Fake", "Name", email, new List <Model.Org> {
                org1, org2
            }, new List <Model.Org>());
        }
Esempio n. 2
0
        // <summary>
        // Update CurUser using the /me API endpoint.
        // </summary>
        async public virtual Task RefreshMe()
        {
            try
            {
                // GET /me
                dynamic userData = await BackendUrl
                                   .AppendPathSegment("users/me")
                                   .WithOAuthBearerToken(AuthToken)
                                   .GetJsonAsync();

                // Convert relevant fields, later on we may want passes, associated orgs, etc.
                CurUser = Model.User.FromDynamic(userData);
            }
            catch (FlurlHttpException ex)
            {
                // Handle errors
                ProcessHttpException(ex);
            }
        }
Esempio n. 3
0
 protected override void OnAppearing()
 {
     Model.User user = ((App)Application.Current).AppBackend.CurUser;
     orgListView.ItemsSource = user?.Participates;
 }