Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

TokenValidationHandler.cs 830B

123456789101112131415161718192021222324252627
  1. using Authentication_test.DBO;
  2. using iiie.Authentication.DBO;
  3. namespace Authentication_test.Controllers.Authentication
  4. {
  5. public class TokenValidationHandler : iiie.Authentication.Business.JWT.TokenValidationHandler
  6. {
  7. protected override BasicUserDbo GetUserDbo(string username, string salt)
  8. {
  9. if (username == "root")
  10. return new BasicUserDbo
  11. {
  12. Id = 42,
  13. Role = (int)UserRoles.Root,
  14. Username = "Root"
  15. };
  16. if (username == "notroot")
  17. return new BasicUserDbo
  18. {
  19. Id = 4242,
  20. Role = (int)UserRoles.NotRoot,
  21. Username = "Not Root"
  22. };
  23. return null;
  24. }
  25. }
  26. }