You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import { AccountsClient } from '@accounts/client';
import { AccountsClientPassword } from '@accounts/client-password';
import GraphQLClient from '@accounts/graphql-client';
import ApolloClient from 'apollo-client';
import { InMemoryCache } from 'apollo-cache-inmemory';
import { HttpLink } from 'apollo-link-http';
import fetch from 'isomorphic-fetch';
import { CookieStorage } from 'cookie-storage';
const cookieStorage = new CookieStorage();
const link = new HttpLink({
uri: 'http://localhost:4000/graphql',
fetch,
});
const cache = new InMemoryCache();
const apolloClient = new ApolloClient({
link,
cache,
});
const accountsGraphQL = new GraphQLClient({ graphQLClient: apolloClient });
const accountsClient = new AccountsClient(
{
// We tell the accounts-js client to use cookieStorage to store the tokens
cookieStorage,
},
accountsGraphQL
);
const accountsPassword = new AccountsClientPassword(accountsClient);
export { accountsClient, accountsGraphQL, accountsPassword, apolloClient };
sadly trying to add tokenStorage: cookieStorage doesn't work.
I will submit a PR for accounts/client basically cloning the token-local implementation to add a cookieStorage option!
I will also change the separator for the name, since : or semicolon's don't look nice in cookies it seems!
Hopefully this is OK, not sure if much of a breaking change or something!
The text was updated successfully, but these errors were encountered:
https://www.npmjs.com/package/cookie-storage
Let's add 🍪Token Storage. so #802 and #804 can be resolved!
Thankfully there's already a package for that!
https://www.npmjs.com/package/cookie-storage
utils/accounts.ts
sadly trying to add tokenStorage: cookieStorage doesn't work.
I will submit a PR for accounts/client basically cloning the token-local implementation to add a cookieStorage option!
I will also change the separator for the name, since : or semicolon's don't look nice in cookies it seems!
Hopefully this is OK, not sure if much of a breaking change or something!
The text was updated successfully, but these errors were encountered: