fix(examples): Offer Storage with non-global client (#489)

This commit is contained in:
Jan-Otto Kröpke 2023-11-20 13:40:42 +01:00 committed by GitHub
parent 7b64687990
commit 7d0cdec925
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -90,6 +90,10 @@ func (s *publicKey) Key() any {
}
func NewStorage(userStore UserStore) *Storage {
return NewStorageWithClients(userStore, clients)
}
func NewStorageWithClients(userStore UserStore, clients map[string]*Client) *Storage {
key, _ := rsa.GenerateKey(rand.Reader, 2048)
return &Storage{
authRequests: make(map[string]*AuthRequest),