示例#1
0
        /// <summary>
        /// adds token and secret to db
        /// </summary>
        /// <param name="username">user to get new token</param>
        /// <param name="jwt">token created</param>
        /// <param name="secret">secret that has signed token</param>
        private void AddTokenToDB(string username, string jwt, byte[] secret)
        {
            // login gateway use to connect to db
            LoginGateway loginGateway = new LoginGateway();

            // dto that is sent to gateway
            LoginDTO loginDTO = new LoginDTO()
            {
                UserName = username,
                Token    = jwt,
                Salt     = Convert.ToBase64String(secret)
            };

            // adds token to db
            loginGateway.AddToTokenList(loginDTO);
        }