Skip to content

Commit 90bfed9

Browse files
committed
minor: Audience: add String method
1 parent 0794a43 commit 90bfed9

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2020-2024 Gerasimos Maropoulos <[email protected]>
3+
Copyright (c) 2020-2025 Gerasimos Maropoulos <[email protected]>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

claims.go

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"encoding/json"
55
"errors"
66
"fmt"
7+
"strings"
78
"time"
89
)
910

@@ -127,6 +128,11 @@ func (aud *Audience) UnmarshalJSON(data []byte) (err error) {
127128
return
128129
}
129130

131+
// String returns the string representation of the audience.
132+
func (auth Audience) String() string {
133+
return strings.Join(auth, " ")
134+
}
135+
130136
// ApplyClaims implements the `SignOption` interface.
131137
// It sets the Audience field to standard Claims instance.
132138
//

0 commit comments

Comments
 (0)