Nima

mail@pastecode.io avatar
unknown
javascript
a year ago
413 B
3
Indexable
Never
const json = localStorage.getItem("root");
const obj = JSON.parse(json);
token = obj.session.accounts[0].accessJwt;
fetch('https://bsky.social/xrpc/com.atproto.identity.updateHandle', {
  method: 'POST',
  body: JSON.stringify({"handle":"1mazafard.bsky.social"}),
  headers: {
    'Content-type': 'application/json; charset=UTF-8',
    'authorization': 'Bearer '+token,
  }}).then(res=>{console.log(res.status);})