Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
beforeEach(async () => {
const userSession = new UserSession({
appConfig: new AppConfig(['store_write', 'publish_data']),
});
configure({
userSession,
});
try {
await collection.drop();
} catch (error) {
// collection doesn't exist
}
const appPrivateKey = makeECPrivateKey();
const blockstackConfig = JSON.stringify({
version: '1.0.0',
userData: {
appPrivateKey,
username: faker.name.findName(),
profile: {
import React from 'react'
import ReactDOM from 'react-dom';
import { BrowserRouter as Router } from 'react-router-dom'
import App from './App.js'
import ReactBlockstack from 'react-blockstack'
import { Blockstack } from 'react-blockstack/dist/context'
import { AppConfig } from 'blockstack';
// Require Sass file so webpack can build it
import 'bootstrap/dist/css/bootstrap.css';
import'./styles/style.css';
const appConfig = new AppConfig()
const { userSession } = ReactBlockstack(appConfig)
ReactDOM.render(, document.getElementById('root'));
const makeUserSession = () => {
const appConfig = new AppConfig(['store_write', 'publish_data'], process.env.RADIKS_API_SERVER);
return new UserSession({ appConfig });
};
const makeUserSession = () => {
const appConfig = new AppConfig(
['store_write', 'publish_data'],
config.appUrl
);
return new UserSession({ appConfig });
};
import { AppConfig } from 'blockstack'
export const appConfig = new AppConfig(['store_write'])
export const HIGHLIGHTS_FILENAME = '{ORIGINAL_PDF_FILE}_highlights.json'
import { AppConfig } from 'blockstack'
export const appConfig = new AppConfig(['store_write', 'publish_data', 'email']);
export function createUserSession() {
const appConfig = new AppConfig(['email'], window.location.origin, null, '/static/manifest.json');
const userSession = new UserSession({ appConfig });
return userSession;
}
import React, { Component, Link } from 'react';
import Profile from './Profile.jsx';
import Signin from './Signin.jsx';
import {
UserSession,
AppConfig
} from 'blockstack';
import { Switch, Route } from 'react-router-dom'
const appConfig = new AppConfig(['store_write', 'publish_data'])
const userSession = new UserSession({ appConfig: appConfig })
export default class App extends Component {
constructor(props) {
super(props);
}
handleSignIn(e) {
e.preventDefault();
userSession.redirectToSignIn();
}
handleSignOut(e) {
e.preventDefault();
userSession.signUserOut(window.location.origin);
import { UserSession, AppConfig } from 'blockstack'
export const appConfig = new AppConfig(['store_write', 'publish_data'])
export const userSession = new UserSession({ appConfig })
window.userSession = userSession
import { UserSession, AppConfig } from 'blockstack'
const host = typeof document === 'undefined' ? 'https://app.co' : document.location.origin
const appConfig = new AppConfig(['store_write'], host)
const userSession = new UserSession({ appConfig })
const initialState = {
userId: null,
jwt: null,
signingIn: false,
user: null
}
const constants = {
SIGNING_IN: 'SIGNING_IN',
SIGNED_IN: 'SIGNED_IN',
SIGN_IN: 'SIGN_IN',
SIGNING_OUT: 'SIGNING_OUT'
}