Ejemplo n.º 1
0
        public bool VerifyEmailPin(string processToken, string pin)
        {
            Context.ThrowIfEmpty(processToken, ClientFaultCodes.ValueMissing, "processToken", "ProcessToken value missing");
            Context.ThrowIfEmpty(pin, ClientFaultCodes.ValueMissing, "pin", "Pin value missing");
            var session = Context.OpenSession();
            var process = _processService.GetActiveProcess(session, LoginProcessType.FactorVerification, processToken);

            Context.ThrowIfNull(process, ClientFaultCodes.ObjectNotFound, "processToken", "Login process not found or expired.");
            var processService = Context.App.GetService <ILoginProcessService>();
            var result         = processService.SubmitPin(process, pin);

            session.SaveChanges();
            return(result);
        }
Ejemplo n.º 2
0
        public bool VerifyEmailPin(string processToken, string pin)
        {
            Context.ThrowIfEmpty(processToken, ClientFaultCodes.ValueMissing, "processToken", "ProcessToken value missing");
            Context.ThrowIfEmpty(pin, ClientFaultCodes.ValueMissing, "pin", "Pin value missing");
            var process = _processService.GetActiveProcess(Context, LoginProcessType.FactorVerification, processToken);

            Context.ThrowIfNull(process, ClientFaultCodes.ObjectNotFound, "processToken", "Login process not found or expired.");
            var processService = Context.App.GetService <ILoginProcessService>();

            if (processService.SubmitPin(process, pin))
            {
                return(true);
            }
            return(false);
        }
Ejemplo n.º 3
0
 //Private utilities
 private ILoginProcess GetActiveProcess(string token, bool confirmedOnly = true) {
   var process = _processService.GetActiveProcess(Context, LoginProcessType.PasswordReset, token);
   if(process == null)
     return null;
   if(confirmedOnly && process.CompletedFactors == ExtraFactorTypes.None)
     return null;
   return process; 
 }
Ejemplo n.º 4
0
        //Private utilities
        private ILoginProcess GetActiveProcess(IEntitySession session, string token, bool confirmedOnly = true)
        {
            var process = _processService.GetActiveProcess(session, LoginProcessType.PasswordReset, token);

            if (process == null)
            {
                return(null);
            }
            if (confirmedOnly && process.CompletedFactors == ExtraFactorTypes.None)
            {
                return(null);
            }
            return(process);
        }