src/index.js
function doLogin (opts, csrf, email, password) {
  return fetch(`${opts.host}/_/auth/login`, json({
    ...opts,
    method: 'post',
    body: { csrf, email, password }
  })).then((response) => props({
    session: getSessionCookie(response.headers.get('set-cookie')),
    body: getJSON(response)
  }))
}
function doLogin (opts, csrf, email, password) {
  return fetch(`${opts.host}/_/auth/login`, json({
    ...opts,
    method: 'post',
    body: { csrf, email, password }
  })).then((response) => props({
    session: getSessionCookie(response.headers.get('set-cookie')),
    body: getJSON(response)
  }))
}
function doLogin ( opts , csrf , email , password ) { return fetch ( ` ${ opts . host } ` , json ( { ... opts , method : 'post' , body : { csrf , email , password } } ) ) . then ( ( response ) => props ( { session : getSessionCookie ( response . headers . get ( 'set-cookie' ) ) , body : getJSON ( response ) } ) ) }
Log in to plug.dj with an email address and password. `opts` must contain headers with a session cookie.
Log in to plug . dj with an email address and password . opts must contain headers with a session cookie .