Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. [HttpGet]
  2. [ActionName("GetUserData")]
  3. public string GetUserData()
  4. {
  5. return HttpContext.User.Claims.FirstOrDefault(x=>x.Type=="Email").Value;
  6. }
  7.  
  8. public void Configure(IApplicationBuilder app, IHostingEnvironment env)
  9. {
  10. if (env.IsDevelopment())
  11. {
  12. app.UseDeveloperExceptionPage();
  13. }
  14. else
  15. {
  16. app.UseHsts();
  17. }
  18. app.UseAuthentication();
  19. //MyMiddleware в этом не причастен, пробовал его убирать
  20. app.UseMiddleware<MyMiddleware>();
  21. app.UseHttpsRedirection();
  22. app.UseMvc();
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement