You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "YakovL (via GitHub)" <gi...@apache.org> on 2023/02/02 08:10:39 UTC
[GitHub] [couchdb-nano] YakovL commented on issue #324: Cookie expiration bug
YakovL commented on issue #324:
URL: https://github.com/apache/couchdb-nano/issues/324#issuecomment-1413309904
Right, I see. I'm thinking about a way to make sure we're authorized before each request
private get authedClientPromise(): Promise<nanoClient.ServerScope> {
return (async () => {
// TODO: check if we are authed
// TODO: if not, do this.client.auth(...)
return this.client
})()
}
Could you suggested a proper way to do the "is authed" check? I understand that we can send a request, check if we got 401 and try to reauth in that case, but doing this in each method is very WET (although better in terms of performance: the "is authed" check is an additional request).
May be it's possible to check the cookie expiration without a request? I'm not finding a dedicated method for this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org