Skip to content
This repository has been archived by the owner on Oct 1, 2019. It is now read-only.

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
voidxnull committed Jun 25, 2017
1 parent a700b9b commit 7165ad5
Show file tree
Hide file tree
Showing 16 changed files with 327 additions and 91 deletions.
6 changes: 2 additions & 4 deletions migrations/20170530231210_users_oauth.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
export async function up(knex) {
await knex.schema.table('users', function (table) {
table.jsonb('providers'); // example: { facebook: {...}, google: {...} }

// TODO: index on ids
table.jsonb('providers'); // example: { facebook: { id: '123' }, google: {...} }
});
}

export async function down(knex) {
await knex.schema.table('', function (table) {
await knex.schema.table('users', function (table) {
table.dropColumn('providers');
});
}
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"bookshelf": "^0.10.3",
"bunyan": "^1.8.1",
"classnames": "~2.2.5",
"client-oauth2": "^4.1.0",
"crypto": "0.0.3",
"debounce-promise": "~3.0.1",
"ejs": "^2.3.4",
Expand Down Expand Up @@ -92,11 +93,15 @@
"moment": "^2.10.6",
"mysql2": "^1.0.0-rc.2",
"oniguruma": "^6.0.1",
"passport-facebook": "^2.1.1",
"passport-facebook-token": "^3.3.0",
"passport-github": "^1.1.0",
"passport-github-token": "^2.1.0",
"passport-google-oauth": "^1.0.0",
"passport-google-oauth20": "^1.0.0",
"passport-google-token": "^0.1.2",
"passport-local": "^1.0.0",
"passport-twitter-token": "^1.3.0",
"passport-twitter": "^1.0.4",
"pg": "^6.0.3",
"promise-streams": "^1.0.1",
"proxy-middleware": "^0.15.0",
Expand Down
1 change: 1 addition & 0 deletions res/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"login.action": "Log in",
"login.with": "Sign in with %0",
"login.create_new": "Create new account",
"login.errors.already_logged_in": "You are already logged in",
"login.errors.invalid.short": "Invalid username or password",
"login.errors.invalid.long": "The username and password that you entered did not match our records. Please double-check and try again",
"login.errors.username_req": "You must enter your username to continue",
Expand Down
3 changes: 3 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ if (exec_env === 'development') {
}));
}

// Workaround for passport strategy callbacks: it only accepts ctx.req.
app.use((ctx, next) => { ctx.req.ctx = ctx; return next(); });

app.use(async (ctx, next) => {
const { hostname } = parseUrl(API_HOST);

Expand Down

0 comments on commit 7165ad5

Please sign in to comment.