Fix recaptcha on login forms
This commit is contained in:
parent
f864b72e0a
commit
66410a35f1
10 changed files with 188 additions and 77 deletions
|
@ -2,17 +2,20 @@ import { createStore } from 'easy-peasy';
|
|||
import flashes, { FlashStore } from '@/state/flashes';
|
||||
import user, { UserStore } from '@/state/user';
|
||||
import permissions, { GloablPermissionsStore } from '@/state/permissions';
|
||||
import settings, { SettingsStore } from '@/state/settings';
|
||||
|
||||
export interface ApplicationStore {
|
||||
permissions: GloablPermissionsStore;
|
||||
flashes: FlashStore;
|
||||
user: UserStore;
|
||||
settings: SettingsStore;
|
||||
}
|
||||
|
||||
const state: ApplicationStore = {
|
||||
permissions,
|
||||
flashes,
|
||||
user,
|
||||
settings,
|
||||
};
|
||||
|
||||
export const store = createStore(state);
|
||||
|
|
25
resources/scripts/state/settings.ts
Normal file
25
resources/scripts/state/settings.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
import { action, Action } from 'easy-peasy';
|
||||
|
||||
export interface SiteSettings {
|
||||
name: string;
|
||||
locale: string;
|
||||
recaptcha: {
|
||||
enabled: boolean;
|
||||
siteKey: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface SettingsStore {
|
||||
data?: SiteSettings;
|
||||
setSettings: Action<SettingsStore, SiteSettings>;
|
||||
}
|
||||
|
||||
const settings: SettingsStore = {
|
||||
data: undefined,
|
||||
|
||||
setSettings: action((state, payload) => {
|
||||
state.data = payload;
|
||||
}),
|
||||
};
|
||||
|
||||
export default settings;
|
Reference in a new issue