# backup method?

**URL:** <https://talk.observablehq.com/t/backup-method/1628>\
**Category:** Help\
**Created:** [January 31, 2019, 1:58pm UTC](https://talk.observablehq.com/t/backup-method/1628 "2019-01-31T13:58:31Z")\
**Posts on this page:** 1\
**Showing post:** 29

<div class="post-metadata">

**Author:** ![bgchen](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/bgchen/32/784_2.png) [@bgchen](https://talk.observablehq.com/u/bgchen)\
**Post date:** [March 24, 2019, 1:53am UTC](https://talk.observablehq.com/t/backup-method/1628/29 "2019-03-24T01:53:12Z")

</div>

Thanks! I used your work to update my version just now:

> <https://gist.github.com/bryangingechen/9d86f1e5ec01674a32dd9c54bdc13947/revisions?diff=split>

I made one change to your new `ensureToken`. Instead of:

```auto
ensureToken(regenerate = false) {
  if (!regenerate && this.getToken()) return;

```

I use:

```auto
ensureToken(regenerate = false) {
  if (!regenerate && this.getToken() && this.getToken().value !== '') return;

```

The third clause is necessary since after authentication, the response from `https://observablehq.com/loggedin` has a `set-cookie` header which reads `set-cookie: T=; Max-Age=0; Domain=.observablehq.com; HttpOnly; Path=/; Secure`.

**Edit** : updated per @mootari’s comment below.

---

_[View the full topic](https://talk.observablehq.com/t/backup-method/1628)._
