﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Configuration;

namespace Privakey
{
    public class PrivakeyUtil
    {
        /// <summary>
        /// Gets the proper redirect URL from the web.config based on whether this is a tap-in or regular login.
        /// </summary>
        /// <param name="isTapIn">Is the user doing a regular log-in or a tap-in (I.E. no PIN required)?</param>
        /// <returns>The redirect URL that should be used.</returns>
        public static string GetCurrentRedirectUrl(bool isTapIn)
        {
            var redirectUrl = "";
            if (isTapIn)
            {
                redirectUrl = WebConfigurationManager.AppSettings["Tap_in_redirect_url"];
            }
            else
            {
                redirectUrl = WebConfigurationManager.AppSettings["Privakey_redirect_url"];
            }

            return redirectUrl;
        }
    }
}