jonataslaw / get_server

A backend server that makes it possible to program with Flutter syntax and reuse existing code
Apache License 2.0
475 stars 43 forks source link

Read jwt token #69

Open leandropnto opened 2 years ago

leandropnto commented 2 years ago

How I can read jwt token after successfully authenticated? For example: In my token I put user Id in JWT payload and I should read this userId to get only userId data.

frcc00 commented 1 year ago

use TokenUtil

var token = TokenUtil.getTokenFromHeader(context.request); var uid = TokenUtil.getClaims(token).issuer;