GetTokenIfExists will return the token from local storage if it exists and not expired
(path string)
| 514 | |
| 515 | // GetTokenIfExists will return the token from local storage if it exists and not expired |
| 516 | func getTokenIfExists(path string) (*jose.JSONWebSignature, error) { |
| 517 | content, err := os.ReadFile(path) // nolint: gosec |
| 518 | if err != nil { |
| 519 | return nil, err |
| 520 | } |
| 521 | token, err := jose.ParseSigned(string(content), signatureAlgs) |
| 522 | if err != nil { |
| 523 | return nil, err |
| 524 | } |
| 525 | return token, nil |
| 526 | } |
| 527 | |
| 528 | // RemoveTokenIfExists removes the a token from local storage if it exists |
| 529 | func RemoveTokenIfExists(appInfo *AppInfo) error { |
no outgoing calls
no test coverage detected