Skip to content

Commit 3f82db8

Browse files
committed
update storage key for auth
1 parent 54ce044 commit 3f82db8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "0.1.2",
2+
"version": "0.1.3",
33
"name": "sveltefire",
44
"svelte": "src/index.js",
55
"main": "dist/index.js",

src/auth.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ import { assertApp } from './helpers';
55
export function userStore(opts = { persist: null }) {
66

77
const auth = assertApp('auth');
8-
const k = 'sveltefire_user';
8+
const storageKey = 'sveltefire_user';
99
let cached = null;
1010

1111
const { persist } = opts;
1212

1313
if (persist) {
14-
cached = JSON.parse(opts.persist.getItem(k));
14+
cached = JSON.parse(opts.persist.getItem(storageKey));
1515
}
1616

1717
const store = writable(cached, () => {
1818
const teardown = auth.onAuthStateChanged(u => {
1919
set(u);
20-
persist && opts.persist.setItem(k, JSON.stringify(u));
20+
persist && opts.persist.setItem(storageKey, JSON.stringify(u));
2121
});
2222
return () => teardown;
2323
});

0 commit comments

Comments
 (0)