I'm trying to use TokenAuthenticatable for a user model, however, when running the app I'm getting this log:
[ ERROR ] ServiceError.make: No services are available for 'AuthenticationCache'. (Container.swift:112)
[ DEBUG ] Suggested fixes for ServiceError.make: Register a service for 'AuthenticationCache'. `services.register(AuthenticationCache.self) { ... }`. (Logger+LogError.swift:20)
After trying to register the AuthenticationCache service in my configuration I'm getting a Use of unresolver identifier error, because AuthenticationCache is not public:
/// Stores authenticated objects. This should be created
/// using the request container as a singleton. Authenticated
/// objects can then be stored here by middleware and fetched
/// later in route closures.
final class AuthenticationCache: Service { ... }
Should this class be public? or maybe I'm doing this wrong, I'm pretty new with vapor and I can't find many guides or references about this.
Hi!
I'm trying to use
TokenAuthenticatable
for a user model, however, when running the app I'm getting this log:After trying to register the
AuthenticationCache
service in my configuration I'm getting aUse of unresolver identifier
error, becauseAuthenticationCache
is not public:Should this class be public? or maybe I'm doing this wrong, I'm pretty new with vapor and I can't find many guides or references about this.
Thank you.