only for use on client
(tokenStr string)
| 358 | |
| 359 | // only for use on client |
| 360 | func ExtractUnverifiedRpcContext(tokenStr string) (*wshrpc.RpcContext, error) { |
| 361 | token, _, err := new(jwt.Parser).ParseUnverified(tokenStr, &wavejwt.WaveJwtClaims{}) |
| 362 | if err != nil { |
| 363 | return nil, fmt.Errorf("error parsing token: %w", err) |
| 364 | } |
| 365 | claims, ok := token.Claims.(*wavejwt.WaveJwtClaims) |
| 366 | if !ok { |
| 367 | return nil, fmt.Errorf("error getting claims from token") |
| 368 | } |
| 369 | return claimsToRpcCtx(claims), nil |
| 370 | } |
| 371 | |
| 372 | // only for use on client |
| 373 | func ExtractUnverifiedSocketName(tokenStr string) (string, error) { |
no test coverage detected