Exemplo n.º 1
0
        public async Task <ActionResult> ValidationRequest([FromQuery] long receiverId)
        {
            var id = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.NameIdentifier).Value;

            var code = authService.New(id, receiverId);
            await mqService.PushChallengeMessage(code, receiverId);

            return(Ok(new ReturnMessage()
            {
                StatusCode = Model.StatusCode.Success
            }));
        }
Exemplo n.º 2
0
        public async Task <ActionResult> InsertSubsriber(string adminToken, int subsriberId)
        {
            if (await databaseService.IsAdminTokenValid(adminToken))
            {
                var challengeCode = authService.GenerateChallengeCode();
                authService.AddAuth(adminToken, challengeCode, subsriberId);
                await mqService.PushChallengeMessage(challengeCode, subsriberId);

                return(Accepted(new { message = "Challenge Code Sent" }));
            }

            return(NotFound());
        }