WithSubject returns an Options that sets the subject to use in the token claims.
(s string)
| 182 | // WithSubject returns an Options that sets the subject to use in the token |
| 183 | // claims. |
| 184 | func WithSubject(s string) Options { |
| 185 | return func(c *Claims) error { |
| 186 | if s == "" { |
| 187 | return errors.New("subject cannot be empty") |
| 188 | } |
| 189 | c.Subject = s |
| 190 | return nil |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | // WithAudience returns a Options that sets the audience to use in the token |
| 195 | // claims. If Audience is not used the default audience will be used. |
no outgoing calls
searching dependent graphs…