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

            await this._applicationStateService.SaveStateAsync();

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