Example #1
0
        public async Task <ActionResult <Profile> > GetProfile()
        {
            var userId  = currentUserId;
            var profile = mapper.Map <Profile>(await evacuationSearchService.GetRegistrantByUserId(userId));

            if (profile == null)
            {
                //try get BCSC profile
                profile = GetUserFromPrincipal();
            }
            if (profile == null)
            {
                return(NotFound(userId));
            }
            return(Ok(profile));
        }
        public async Task <ActionResult <Profile> > GetProfile()
        {
            var userId  = User.FindFirstValue(ClaimTypes.NameIdentifier);
            var profile = mapper.Map <Profile>(await evacuationSearchService.GetRegistrantByUserId(userId));

            if (profile == null)
            {
                //try get BCSC profile
                profile = GetUserFromPrincipal();
            }
            if (profile == null)
            {
                return(NotFound(userId));
            }
            return(Ok(profile));
        }