Change Google auth strategy

This commit is contained in:
Jonathan Cremin 2018-03-11 20:22:17 +00:00
parent 0d4bd47251
commit bd85678303
5 changed files with 20 additions and 10 deletions

View file

@ -30,3 +30,7 @@ watch-frontend: ## Build and watch frontend for changes
.PHONY: docker-compose-up
docker-compose-up: ## Start (and create) docker containers
docker-compose up -d
.PHONY: yarn
yarn: ## Migrate database schema
docker-compose run --rm app yarn

View file

@ -8,8 +8,8 @@ services:
VUE_ENV: server
DATABASE_URL:
REDIS_URL:
GOOGLE_EMAIL:
GOOGLE_PASSWORD:
GOOGLE_ANDROID_ID:
GOOGLE_MASTER_TOKEN:
XBOX_CLIENT_ID:
XBOX_CLIENT_SECRET:
YOUTUBE_KEY:
@ -27,8 +27,8 @@ services:
VUE_ENV: server
DATABASE_URL:
REDIS_URL:
GOOGLE_EMAIL:
GOOGLE_PASSWORD:
GOOGLE_ANDROID_ID:
GOOGLE_MASTER_TOKEN:
XBOX_CLIENT_ID:
XBOX_CLIENT_SECRET:
YOUTUBE_KEY:

View file

@ -3,8 +3,8 @@ import fs from 'fs';
const services = [];
fs.readdirSync(path.join(__dirname, 'services')).forEach(function(file) {
var service = require(path.join(__dirname, 'services', file));
fs.readdirSync(path.join(__dirname, 'services')).forEach((file) => {
const service = require(path.join(__dirname, 'services', file));
if (service.search) {
services.push(service);
}

View file

@ -8,11 +8,16 @@ const debug = debuglog('combine.fm:google');
const pm = bluebird.promisifyAll(new PlayMusic());
if (!process.env.GOOGLE_EMAIL || !process.env.GOOGLE_PASSWORD) {
debug('GOOGLE_EMAIL or GOOGLE_PASSWORD environment variables not found, deactivating Google Play Music.');
if (!(process.env.GOOGLE_EMAIL && process.env.GOOGLE_PASSWORD) && !(process.env.GOOGLE_ANDROID_ID && process.env.GOOGLE_MASTER_TOKEN)) {
debug('Required GOOGLE_* environment variables not found, deactivating Google Play Music.');
}
let ready = pm.initAsync({email: process.env.GOOGLE_EMAIL, password: process.env.GOOGLE_PASSWORD}).catch(function(err) {
const creds = {
androidId: process.env.GOOGLE_ANDROID_ID,
masterToken: process.env.GOOGLE_MASTER_TOKEN,
}
let ready = pm.initAsync(creds).catch(function(err) {
debug(err);
});

View file

@ -4,7 +4,7 @@
<div class="container">
<h1 class="title">
<router-link to="/" exact>
<img src="/assets/images/logo-128.png"> <b>combine</b><span class="lighter">.fm</span>
<img src="/assets/images/logo-128.png"><b>combine</b><span class="lighter">.fm</span>
</router-link>
</h1>
</div>
@ -35,6 +35,7 @@ body {
}
.header {
font-family: 'Comfortaa', cursive;
letter-spacing: -2px;
background: #FE4365;
}
.header img {