This repository was archived by the owner on Nov 21, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
packages/cognito-module/docs/guide Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 33Vuex module to interface with AWS Cognito
44
55Install:
6+
7+ ``` bash
8+ npm install @vuetify/vuex-cognito-module
9+ ```
10+
611``` bash
712yarn add @vuetify/vuex-cognito-module
813```
914
15+ ## Vue
16+
1017Import into your project's entry point (** src/main.js** in most Vue projects)
1118
1219``` js
1320import attachCognitoModule from ' @vuetify/vuex-cognito-module'
1421```
1522
1623Attach cognito module to the store
24+
1725``` js
1826import store from ' ./store'
1927
@@ -26,4 +34,31 @@ attachCognitoModule(store, {
2634```
2735
2836### Example Project
37+
2938An example project can be found [ here] ( https://github.com/vuetifyjs/vuex-cognito-example )
39+
40+ ## Nuxt
41+
42+ Create a Nuxt plugin in the ** plugins/** directory in your Nuxt project.
43+
44+ Within your plugin file attach the cognito module to the store
45+
46+ ``` js
47+ import attachCognitoModule from ' @vuetify/vuex-cognito-module'
48+
49+ export default (ctx , inject ) => {
50+ const store = ctx .store
51+ attachCognitoModule (store, {
52+ userPoolId: ' your-data-here' ,
53+ identityPoolId: ' your-data-here' ,
54+ userPoolWebClientId: ' your-data-here' ,
55+ region: ' your-data-here'
56+ }, ' cognito' )
57+ }
58+ ```
59+
60+ And finally in your ** nuxt.config.js** file register your plugin.
61+
62+ ``` js
63+ plugins: [' @/plugins/vuex-cognito-module.js' ]
64+ ```
You can’t perform that action at this time.
0 commit comments