Environment agnostic for users-permissions configs

This commit is contained in:
Jim Laurie 2018-02-13 15:04:21 +01:00
parent 520c0bfcc8
commit 957e7a08cb
5 changed files with 14 additions and 1 deletions

View File

@ -29,7 +29,7 @@ module.exports = async cb => {
}
const pluginStore = strapi.store({
environment: strapi.config.environment,
environment: '',
type: 'plugin',
name: 'users-permissions'
});

View File

@ -16,6 +16,7 @@ module.exports = {
const params = ctx.request.body;
const store = await strapi.store({
environment: '',
type: 'plugin',
name: 'users-permissions'
});
@ -128,6 +129,7 @@ module.exports = {
connect: async (ctx, next) => {
const grantConfig = await strapi.store({
environment: '',
type: 'plugin',
name: 'users-permissions',
key: 'grant'
@ -204,6 +206,7 @@ module.exports = {
register: async (ctx) => {
if (!(await strapi.store({
environment: '',
type: 'plugin',
name: 'users-permissions',
key: 'advanced'

View File

@ -71,6 +71,7 @@ module.exports = {
create: async (ctx) => {
if ((await strapi.store({
environment: '',
type: 'plugin',
name: 'users-permissions',
key: 'advanced'
@ -101,6 +102,7 @@ module.exports = {
update: async (ctx, next) => {
try {
const advancedConfigs = await strapi.store({
environment: '',
type: 'plugin',
name: 'users-permissions',
key: 'advanced'

View File

@ -172,6 +172,7 @@ module.exports = {
getEmailTemplate: async (ctx) => {
ctx.send(await strapi.store({
environment: '',
type: 'plugin',
name: 'users-permissions',
key: 'email'
@ -184,6 +185,7 @@ module.exports = {
}
await strapi.store({
environment: '',
type: 'plugin',
name: 'users-permissions',
key: 'email'
@ -194,6 +196,7 @@ module.exports = {
getAdvancedSettings: async (ctx) => {
ctx.send(await strapi.store({
environment: '',
type: 'plugin',
name: 'users-permissions',
key: 'advanced'
@ -206,6 +209,7 @@ module.exports = {
}
await strapi.store({
environment: '',
type: 'plugin',
name: 'users-permissions',
key: 'advanced'
@ -216,6 +220,7 @@ module.exports = {
getProviders: async (ctx) => {
ctx.send(await strapi.store({
environment: '',
type: 'plugin',
name: 'users-permissions',
key: 'grant'
@ -228,6 +233,7 @@ module.exports = {
}
await strapi.store({
environment: '',
type: 'plugin',
name: 'users-permissions',
key: 'grant'

View File

@ -50,6 +50,7 @@ exports.connect = (provider, query) => {
});
const advanced = await strapi.store({
environment: '',
type: 'plugin',
name: 'users-permissions',
key: 'advanced'
@ -97,6 +98,7 @@ const getProfile = async (provider, query, callback) => {
const access_token = query.access_token || query.code || query.oauth_token;
const grant = await strapi.store({
environment: '',
type: 'plugin',
name: 'users-permissions',
key: 'grant'