Click here to Skip to main content
16,012,352 members

Comments by zamanipour (Top 7 by date)

zamanipour 7-Sep-19 10:14am View    
actually this code add claim to your claim list, you can change it with mine if you like:
var Claims = new Claim[]
{
new Claim(JwtRegisteredClaimNames.Sub,userId)
};
for further information you can read the document that i've mentioned above. implementing jwt is a step by step process and you have to use a comprehensive guide for that.
zamanipour 7-Sep-19 8:29am View    
check out https://www.codeproject.com/Articles/5160941/ASP-NET-CORE-Token-Authentication-and-Authorizatio
zamanipour 7-Sep-19 8:28am View    
i just changed a line in your own code: 'new Claim(JwtRegisteredClaimNames.Sub,userId)' and replaced it with new custom name/value pair. you can add as many claims as you want. for using jwt, it depends on your front-end technology. after you implement the required logic to decrypt your message in front-end (search for it based on your technology) you can have your payload as a json object and you can use claims object to modify the page.
zamanipour 7-Sep-19 8:10am View    
maybe the problem raise from the initial value of dtp2.Value. check it to be valid or use a valid date for test, like : 'm = new DateTime()' and then: 'dtp2.Value = New DateTime(m.Year, m.Month, 1).AddMonths(1).AddDays(-1)'
zamanipour 7-Sep-19 7:28am View    
what i can suggest is to check the incoming data first: console.log(data); it might be 'undefined' or 'null'. if so, what exactly your back-end passed. go check your back-end return value. also check for 'cache: false' and if all was not working, use .done() as mentioned in https://api.jquery.com/jquery.ajax/