Skip to content

Instantly share code, notes, and snippets.

View dclarke-modus's full-sized avatar

dclarke-modus

View GitHub Profile
*Code to save Client and Scope:*
```javascript
let scope = new ScopeModel();
scope.client = client._id;
scope.markModified('client');
console.log(scope);
await scope.save();
```
/home/vagrant/api/node_modules/babel-core/lib/transformation/file/index.js:590
throw err;
^
SyntaxError: /home/vagrant/api/db/connection.js: Unexpected token (5:11)
3 |
4 | class ConnectionManager {
> 5 | protected mongoClient;
| ^
6 | constructor() {
async getClient (clientId, clientSecret, callback) {
let client = await this.mongoClient.collection('client').findOne({"client" : clientId, "client_secret" : clientSecret}, {"_id" : 1});
let scopes = await this.mongoClient.collection('scope').find({"client_id" : client._id });
console.log(scopes.toArray());
}
async getClient (clientId, clientSecret, callback) {
let client = await this.mongoClient.collection('client').findOne({"client" : clientId, "client_secret" : clientSecret}, {"_id" : 1});
let scopes = await this.mongoClient.collection('scope').find({"client_id" : client._id }).toArray();
console.log(scopes);
}
//App.js
var React = require('react');
var CSSModules = require('react-css-modules');
var ReactRouter = require('react-router-dom');
var Router = ReactRouter.BrowserRouter;
var Route = ReactRouter.Route;
import styles from '../../../../sass/layout/_layout.scss';
var Index = require('../pages/Index');
var SideBar = require('../component/SideBar');
$ npm run build
> [email protected] build /home/vagrant/Projects/com_oauth_manager/media/com_oauth_manager/js/com_oauthmanager
> webpack --progress --colors --watch --display-error-details
0% compiling
Webpack is watching the files…
Hash: adb43be39ed04e0ec5c3
Version: webpack 3.7.1
ERROR in ./node_modules/css-loader!./node_modules/sass-loader/lib/loader.js!/home/vagrant/Projects/com_oauth_manager/media/com_oauth_manager/sass/layout/_layout.sass
Module build failed:
$base-font-family: $font-stack-system;
^
Undefined variable: "$font-stack-system".
in /home/vagrant/Projects/com_oauth_manager/media/com_oauth_manager/sass/base/_variables.scss (line 2, column 20)
Error:
$base-font-family: $font-stack-system;
^
Undefined variable: "$font-stack-system".
//ERROR
ERROR in ./app/index.js
Module parse failed: /home/vagrant/Projects/com_oauth_manager/media/com_oauth_manager/js/com_oauthmanager/app/index.js Unexpected token (6:16)
You may need an appropriate loader to handle this file type.
| var App = require('./component/App');
|
| ReactDOM.render(<App />, document.getElementById('oauth-manager'));
//WEBPACK.CONFIG.JS
const ExtractTextPlugin = require("extract-text-webpack-plugin");
ERROR in /home/vagrant/Projects/com_oauth_manager/media/com_oauth_manager/sass/layout/_layout.sass
Module build failed:
.oauth-manager-container {
^
Invalid CSS after "...ger-container {": expected "}", was "{"
in /home/vagrant/Projects/com_oauth_manager/media/com_oauth_manager/sass/layout/_layout.sass (line 4, column 27)
Error:
.oauth-manager-container {
^
Invalid CSS after "...ger-container {": expected "}", was "{"
ERROR in /home/vagrant/Projects/com_oauth_manager/media/com_oauth_manager/sass/layout/_layout.sass
Module parse failed: /home/vagrant/Projects/com_oauth_manager/media/com_oauth_manager/sass/layout/_layout.sass Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "bourbon/bourbon";
| @import "base/base";
|
@ ./app/component/App.js 5:0-47
@ ./app/index.js