示例#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;
        }
示例#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"));
            }
        }
示例#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);
 }
示例#4
0
        private async Task AfterLoginAsync(User user)
        {
            this._applicationStateService.SetCurrentUser(user);

            await this._applicationStateService.SaveStateAsync();

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