Creates a new Authenticator that stores user info in the given Bucket. Uses the default metadataKeys format
(datastore base.DataStore, channelComputer ChannelComputer, options AuthenticatorOptions)
| 83 | |
| 84 | // Creates a new Authenticator that stores user info in the given Bucket. Uses the default metadataKeys format |
| 85 | func NewAuthenticator(datastore base.DataStore, channelComputer ChannelComputer, options AuthenticatorOptions) *Authenticator { |
| 86 | |
| 87 | if len(options.Collections) == 0 { |
| 88 | options.Collections = defaultCollectionMap |
| 89 | } |
| 90 | |
| 91 | if options.MetaKeys == nil { |
| 92 | options.MetaKeys = base.DefaultMetadataKeys |
| 93 | } |
| 94 | |
| 95 | return &Authenticator{ |
| 96 | datastore: datastore, |
| 97 | channelComputer: channelComputer, |
| 98 | AuthenticatorOptions: options, |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | func DefaultAuthenticatorOptions(ctx context.Context) AuthenticatorOptions { |
| 103 | return AuthenticatorOptions{ |
no outgoing calls