Example #1
0
        public async Task <string> GetRedirectUrlAsync(Guid ticketId, string ticketValidationUrl)
        {
            Ticket ticket = await _tickets.GetAsync(ticketId);

            if (ticket == null)
            {
                throw new TicketNotFoundException();
            }

            if (ticket.Event.IncludePersonalInformation)
            {
                var claims   = GetClaims(ticket, ticketValidationUrl);
                int lifetime = 365 * 24 * 3600; // 365 days.
                var jwt      = await _tokenService.IssueJwtAsync(lifetime, claims);

                var sb = new StringBuilder(ticket.Event.HomepageUrl);
                sb.Append(jwt);
                return(sb.ToString());
            }
            return(ticket.Event.HomepageUrl);
        }