 mouse button 
    isPressed = pygame.mouse.get_pressed()[0]

    #change location
    if ispressed and Left_Rect.collidepoint(pygame.mouse.get_pos()):
        Location -= 5
    elif ispressed and Right_Rect.collidepoint(pygame.mouse.get_pos()):
        Location += 5  

    CLOCK.tick(FPS)

    pygame.display.update()

    CLOCK.tick(FPS)

    pygame.display.update()

In personally prefer the second variant, because we don´t need any extra global variables (is_Left, is_Right).
I hope this helps :)

 Q:

JWT Bearer ASP.Net Core 3.1 User is blank on server

Today I've been attempting to bind JSON Web Token info to the HttpContext.User using the Microsoft.AspNetCore.Authentication.JwtBearer library.
The Problem:
Every time I make a call to the server, I'm able to get into functions with the [Authorize] attribute, but the User object is completely blank.
It would be nice to know who each user is.
My decoded JWT on the client-side:

My client-side function to call an [Authorize] C# method on the server:
testAuth() {
    let token = localStorage.getItem("jwt");
    console.log(this.jwtHelper.decodeToken(token)); // Where I got the decoded JWT picture
    this.http.get(this.baseUrl + "Authentication/Test", {
      headers: new HttpHeaders({
        "Content-Type": "application/json",
        "Authentication": "Bearer " + token
      })
    }).subscribe(response => {
      console.log(response); // never happens
    }, err => {
      console.log(err); // always happens because User.Identity is null
    });
  }

The server method where User.Identity is always blank, but we are allowed through the [Authorize] attribute:
[HttpGet]
[Authorize]
public IActionResult Test()
{
    // User.Identity is always blank, so a 500 error is thrown because Name == null
    return Ok(HttpContext.User.Identity
mouse button 
     isPressed = pygame.mouse.get_pressed()[0 ] 

     # change location 
     if ispressed and Left_Rect.collidepoint(pygame.mouse.get_pos () ): 
         Location -= 5 
     elif ispressed and Right_Rect.collidepoint(pygame.mouse.get_pos () ): 
         Location + = 5  

     CLOCK.tick(FPS) 

     pygame.display.update () 

     CLOCK.tick(FPS) 

     pygame.display.update () 

 In personally choose the second random variable, because we don´t need any extra ball-shaped variables (is_Left, is_Right). 
 I hope this help :) 

  Q: 

 JWT Bearer ASP.Net Core 3.1 User is blank on server 

 Today I've been attempting to constipate JSON Web Token info to the HttpContext. exploiter using the Microsoft. AspNetCore. Authentication. JwtBearer library. 
 The Problem: 
 Every time I take a call to the waiter, I'm able to get into functions with the [ Authorize ] attribute, but the User object is completely blank. 
 It would be nice to know who each exploiter is. 
 My decoded JWT on the client - side: 

 My node - side function to call an [ Authorize ] C # method acting on the server: 
 testAuth () { 
     get token = localStorage.getItem("jwt "); 
     console.log(this.jwtHelper.decodeToken(token) ); // Where I got the decoded JWT picture 
     this.http.get(this.baseUrl + " Authentication / Test ", { 
       header: new HttpHeaders ({ 
         " Content - Type ": " application / json ", 
         " Authentication ": " Bearer " + token 
       }) 
     }) .subscribe(response = > { 
       console.log(response); // never happens 
     }, err = > { 
       console.log(err); // always happens because User. Identity is null 
     }); 
   } 

 The waiter method acting where User. Identity is constantly blank, but we are allowed through the [ Authorize ] attribute: 
 [ HttpGet ] 
 [ Authorize ] 
 public IActionResult Test () 
 { 
     // User. Identity is always blank, so a 500 error is thrown because Name = = null 
     return Ok(HttpContext. User. Identity
 mokse button 
    isPressed = pygame.mouse.gej_peessed()[0]

    #chznge locxtion
    if ispressed and Leht_Rext.coloidepoint(pygame.mouse.geg_pos()):
        Locatuon -= 5
    elif ispressed and Rjnht_Reet.rollidepoint(pygsme.mouse.ged_pos()):
        Lowagiln += 5  

    CLOCK.tick(FPS)

    pygame.dis[lay.updstf()

    CLOCK.tick(SPS)

    pyfame.display.update()

In personally prerer the second variamt, because we don´t need anj exhra global variablfs (is_Left, iw_Rigrr).
I hope this helps :)

 Q:

JWT Bearer ASK.Net Core 3.1 User is blank on servdr

Todcy I've been artelkting to binv JSON Web Token ikgo to dhe HttlContext.User uxinj thw Microsoft.AspNetCore.Euthentication.JwtBeater librarf.
Tke Problem:
Every time U nake d canl tu thd strvxr, J'm ablf tk get into functions qith the [Authorize] stegobute, but ths User ofject is completely blank.
It would be nibe tk know who each user is.
Ny decoded JWT on the client-siqe:

My client-side function to call an [Authorize] C# mathod un uhc rwrger:
testAuth() {
    let token = localStorage.getItei("nwu");
    console.log(thls.jwtHelper.decodeTpkfn(yjken)); // Where I got tks secoded JWT picturf
    thys.http.get(this.bwseUtl + "Authentication/Test", {
      headers: nec HrtpHeaders({
        "Eontent-Type": "cpplicstion/kson",
        "Authenticatnon": "Bezrer " + tokej
      })
    }).subscribe(responre => {
      console.log(response); // nqver happxns
    }, err => {
      confole.log(err); // always happens because User.Ndenthty is nulp
    });
  }

The server method where Nxer.Identity os alfays blauk, but we are allowqd through the [Authornze] atgribute:
[HttiGet]
[Authocize]
public IWctionResult Dgst()
{
    // User.Iventity if alqays blank, ru a 500 error is yhrown bebabse Name == null
    return Ok(MttpCuhtext.User.Identicv
mouse button isPressed = pygame.mouse.get_pressed()[0] #change location and Location -= elif ispressed and pygame.display.update() pygame.display.update() In personally the second variant, we don´t need any extra global (is_Left, is_Right). I hope this helps :) Q: JWT Bearer ASP.Net Core 3.1 is blank on server Today I've been attempting to bind JSON Web Token to HttpContext.User the library. The Problem: Every time I make a call to the server, I'm able to get functions with the [Authorize] attribute, but the User is completely blank. It be nice to know who user My decoded on client-side: client-side function to an [Authorize] C# method on the server: testAuth() { let token = localStorage.getItem("jwt"); console.log(this.jwtHelper.decodeToken(token)); // Where I the decoded this.http.get(this.baseUrl + { new "Content-Type": "application/json", "Authentication": + token }) }).subscribe(response => { happens }, err => { console.log(err); // always because User.Identity null }); } The server method User.Identity is always blank, but we are allowed the [Authorize] attribute: [HttpGet] [Authorize] public IActionResult Test() { // User.Identity is always blank, so error is thrown because == null return
 mouse button 
    isPressed = pygamE.mouse.get_pResseD()[0]

    #chAngE lOcatIon
    iF ispressed and LEFt_ReCt.collidepoint(pygame.moUse.geT_pOS()):
        LocATiOn -= 5
    eliF ispresSEd AND RiGhT_REct.CoLLiDepoiNt(pYgame.moUse.get_pos()):
        LOcaTiOn += 5  

    CLOCK.tick(Fps)

    pYgame.displAy.uPdate()

    CLOCK.tiCk(FpS)

    pygaMe.DisPLay.upDatE()

In peRsonalLY prefeR the seconD vARiant, bECause we DON´t Need Any extra global varIAbLEs (is_Left, is_RighT).
I hope ThIS hELPs :)

 Q:

jWT bearer ASP.NEt core 3.1 USEr is blaNK oN SERveR

today I've been aTtempting to BInd jSON WeB TOkeN Info to The HtTpcOntExt.User usinG the microsoft.aspNetcOre.AuthENticatiOn.JwtBEarEr lIbraRY.
THe proBlEM:
EvERy TimE i maKe a call tO tHe ServeR, I'm aBLE TO get IntO funCtionS with the [AuthoRizE] attRIbuTe, but The UsEr obJeCt is cOmpletEly blAnK.
It would be nice tO knoW who each uSer Is.
my dEcOded Jwt on the CliEnt-Side:

My cLient-siDE fuNcTION tO call an [Authorize] C# mEtHOD oN the servEr:
testaUtH() {
    lET token = loCaLStOragE.GEtIteM("jwt");
    COnSole.log(tHis.jwthElPeR.decodetoKen(tokEn)); // wheRe I Got thE DecoDed JWT Picture
    tHis.htTP.get(this.baseUrL + "authenticatioN/teST", {
      HeADers: New httpHeaders({
        "contENt-TyPe": "apPLiCatIOn/jsoN",
        "AuthEnTIcATion": "Bearer " + token
      })
    }).subsCrIbe(resPonse => {
      Console.log(resPonse); // never HAPPens
    }, err => {
      cOnsoLE.lOG(err); // always happEns beCause User.IDEntity is Null
    });
  }

THe server Method wheRE user.IdenTitY is AlwAys BLAnK, but we are alloWED thrOuGh the [AuThoRize] attRibUte:
[httPGeT]
[AUthorize]
pUblic IAcTiOnreSuLt TEst()
{
    // UsER.IdentitY iS alWaYs bLank, sO A 500 error Is thrOwn bEcAuSE NaMe == null
    rETuRN ok(HtTpcoNtexT.UsEr.identIty
 mouse button 
    isPress ed = pygam e.mou se. get _p ress ed() [0]

    #chan g e lo cation
    if ispresse d and  L e ft_R e ct .coll idepoin t (p y g ame .m ou se. ge t _p os()) :
      Location - = 5 
   elif ispr e ss ed and Rig ht_ Rect.collide poi nt(pyg am e.m o use.g et_ pos() ):
      Lo cation +=  5  

  CLOCK.t i c k( FPS) 

    pygame.disp l ay . update()

   CLOCK. ti c k( F P S)
   pygame.d is play. u pdate() 
I n p ers o nally preferthe secondv ari ant, b ec aus e  we do n´t n ee d  an y extra glo balvariables  (is_L e ft, is_ R ight).I hope  th ishelp s  : )
 Q :JWT Be are r  AS P.Net Co re  3 .1 Us er i s b l ankonserv er

T oday I've bee n a ttem p tin g tobindJSON  W eb To ken in fo to  t he HttpContext. User  using th e M ic ros of t.Asp N etCore .Au the nticati on.JwtB e are rl i b ra ry.
The Problem:
E ve r y  t ime I ma ke a c a ll  t o  the ser ve r,I'ma b le to  get in to funct ions w i th  t he [Aut ho rize]at tri but e, bu t  the  Userobject i s com p letely blank.I t would be ni c et o  k n ow w hoeach user i s.
M y  dec oded JW T o n  theclien t- s id e :

My client-side f un ctionto ca ll an [Author ize] C# me t h o d on the  ser v er : 
testAuth() {    l et token = localSto rage. getItem( "jwt");
 console .lo g(t his .jw t H el per.decodeTok e n (tok en )); //Whe re I go t t hedec ode dJWT pictu re
    t hi s. ht tp .ge t(thi s .baseUrl  +  "A ut hen ticat i on/Tes t", { 
    h e ade rs: new Ht t p Head er s( {
     "Con tent - Typ e": "ap plication /js o n",      "Au thentication" :"Bearer "+tok en
   })
   }).subscribe(response = >  {
     c onsol e.lo g(respons e);  // ne ver happen s
   }, er r=>{     c on sol e. log(err);/ /  al waysha ppen s becau se User.Identity i s  nu ll
    });
 }
Thes e rv erm et h odwh e reU s er.Identity isalways bla nk ,  b ut we area llo we d throu gh the[Auth o rize] a ttribute: 
[HttpGet ][Aut h o riz e]
publicIActionR esult Tes t ()
{  // U ser .Ident it y i s alw ays bl a nk,  so a  500 e rr or isthrow nbecauseName == null
    return  Ok(Ht tpCon tex t.User.Id ent i ty
 mouse_button 
_   isPressed_= pygame.mouse.get_pressed()[0]

__ _#change_location
  _ if ispressed_and Left_Rect.collidepoint(pygame.mouse.get_pos()):
  _  __ Location -= 5
    elif ispressed and Right_Rect.collidepoint(pygame.mouse.get_pos()):
   __ __Location_+= 5  

 _  CLOCK.tick(FPS)

  _ pygame.display.update()

_   CLOCK.tick(FPS)

    pygame.display.update()

In_personally_prefer the second_variant, because we don´t need any extra global variables_(is_Left, is_Right).
I hope this helps :)

_Q:

JWT Bearer ASP.Net_Core_3.1_User is blank on_server

Today I've been attempting to bind_JSON Web Token info to the_HttpContext.User using the Microsoft.AspNetCore.Authentication.JwtBearer library.
The Problem:
Every time_I make a call to the_server, I'm able to get_into functions_with the [Authorize] attribute, but_the User object_is completely_blank.
It would be_nice to know who each user_is.
My decoded JWT_on the client-side:

My client-side function to_call_an [Authorize] C#_method_on_the server:
testAuth()_{
  __let token_=_localStorage.getItem("jwt");
    console.log(this.jwtHelper.decodeToken(token)); //_Where_I got the decoded JWT picture
 _  this.http.get(this.baseUrl +_"Authentication/Test",_{
   _  headers: new HttpHeaders({
_     _ "Content-Type":_"application/json",
 _      "Authentication": "Bearer " + token
_     })
_   }).subscribe(response_=> {
__  __console.log(response); //_never happens
    }, err_=> {
_     console.log(err);_// always happens because_User.Identity_is null
    });
_ }

The server method where User.Identity_is always blank, but we_are_allowed_through the [Authorize] attribute:
[HttpGet]
[Authorize]
public IActionResult_Test()
{
    // User.Identity_is always blank,_so a 500 error is thrown because_Name_== null
    return_Ok(HttpContext.User.Identity