Ejemplo n.º 1
0
        public async Task<GeoLocationState> GetGeoLocationStateAsync(User user)
        {
            if (user.SupportsGeoLocation == false)
                return GeoLocationState.NotRequired;

            if (await this.HasAccessAsync() == false)
                return GeoLocationState.RequiredNotAvailable;

            return GeoLocationState.RequiredAndAvailable;
        }
Ejemplo n.º 2
0
        public async Task RememberUserForBiometricAuthAsync(User user)
        {
            Guard.NotNull(user, nameof(user));

            var result = await UserConsentVerifier.RequestVerificationAsync(CTime2CoreResources.Get("BiometricsService.RememberLogin"));

            if (result == UserConsentVerificationResult.Verified)
            {
                this._applicationStateService.SetBiometricAuthUser(user);
            }
            else if (result == UserConsentVerificationResult.DeviceNotPresent)
            {
                throw new CTimeException(CTime2CoreResources.Get("BiometricsService.NoBiometricDevicePresent"));
            }
        }
Ejemplo n.º 3
0
 public static async Task SaveTimer(this ICTimeService self, User user, TimeState state)
 {
     await self.SaveTimer(user.Id, string.Empty, DateTime.Now, user.CompanyId, state, user.SupportsGeoLocation);
 }
Ejemplo n.º 4
0
        private async Task AfterLoginAsync(User user)
        {
            this._applicationStateService.SetCurrentUser(user);

            await this._applicationStateService.SaveStateAsync();

            this._shell.CurrentMode = IoC.Get<LoggedInApplicationMode>();
        }