mirror of
https://github.com/strapi/strapi.git
synced 2025-07-29 11:58:29 +00:00
reload grant value to db when add/delete provider
This commit is contained in:
parent
6b8f430872
commit
e69dcc433b
@ -34,8 +34,7 @@ module.exports = async cb => {
|
||||
name: 'users-permissions'
|
||||
});
|
||||
|
||||
if (!await pluginStore.get({key: 'grant'})) {
|
||||
const value = {
|
||||
const grantValue = {
|
||||
email: {
|
||||
enabled: true,
|
||||
icon: 'envelope'
|
||||
@ -75,8 +74,12 @@ module.exports = async cb => {
|
||||
callback: '/auth/twitter/callback'
|
||||
}
|
||||
};
|
||||
|
||||
await pluginStore.set({key: 'grant', value});
|
||||
const prevGrantValue = await pluginStore.get({key: 'grant'})
|
||||
// store grant auth config to db
|
||||
// when plugin_users-permissions_grant is not existed in db
|
||||
// or we have added/deleted provider here.
|
||||
if (!prevGrantValue || !_.isEqual(_.keys(prevGrantValue), _.keys(grantValue))) {
|
||||
await pluginStore.set({key: 'grant', value: grantValue});
|
||||
}
|
||||
|
||||
if (!await pluginStore.get({key: 'email'})) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user