Published
Edited
Aug 28, 2021
Importers
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
initial_state = {
if (!state && CLIENT_ID) {
await setState({
status: "unauthorized",
state: randomId()
});
} else if (!state && !CLIENT_ID) {
mutable state = {
status: "unconfigured"
};
}
}
Insert cell
exchange_token = {
if (
state &&
state.last_code !== pageParams.code &&
pageParams.code &&
state.state === pageParams.state
) {
exchange();
}
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
tokenBasicAuth = {
if (USE_BASIC_AUTH) {
return {
protocol: 'RFC 7617',
username: CLIENT_ID,
passwordSecret: CLIENT_SECRET_SECRET_NAME
};
}
}
Insert cell
Insert cell
Insert cell
resolveConfig = arg => {
if (typeof arg === 'function') {
return arg({
CLIENT_ID,
REDIRECT_URI,
SCOPES,
code: pageParams.code,
state: state.state
});
} else {
return arg;
}
}
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more