How can I get the session in vuejs .... the router...
# support-questions-legacy
d
How can I get the session in vuejs .... the router load before the package and the init function
r
hey @devertry|deepsheep you can do supertokens init ont he global level
d
how can I do ?
Copy code
ts
SuperTokens.init({
  appInfo: {
    appName: "formelegal",
    apiDomain: env.VUE_APP_BASE_URL,
    apiBasePath: "/auth",
  },
  recipeList: [
    Session.init({
      tokenTransferMethod: "cookie",
    }),
    ThirdPartyEmailPassword.init(),
    EmailPassword.init(),
  ],
});
I set this in main.ts
r
where in main.ts?
d
in vuejs app
in the end ?
I can access to session just in the router it's false when I do doesSessionExist , but i can call my api
r
whats the value of env.VUE_APP_BASE_URL? And what API are you querying when calling sign in?
d
Copy code
ts
import { signIn } from "supertokens-web-js/recipe/emailpassword";
and VUE_APP_BASE_URL = my api endpoint
r
whats the cookie store on the frontend? Can you send a screenshot?
d

https://cdn.discordapp.com/attachments/1097797954263322726/1097801417550479441/Screenshot_20230418_103046.png

r
whats the cookie values in applications tab?
d

https://cdn.discordapp.com/attachments/1097797954263322726/1097803240474681384/Screenshot_20230418_103800.png

can you fire just one message when you have a problem .... it fire in loop
r
can you please clearly explain what the issue is? I'm unable to understand most things you are saying. Consider using a translator please.
d
I cannot limitate part of the app in vuejs
I need to set ser can access everyting at /auth other they cannot access
and i cannot access to session.doesSessionxist return me false every time I try ( because it loads to early )
r
what do you mean by loads too early?
where are you calling session.doesSessionExist?
Can you share some code?
d

https://cdn.discordapp.com/attachments/1097797954263322726/1097816193081024522/Screenshot_20230418_112929.png

r
are you calling doesSessionExist without using
await
in front of it?
d
no ?
r
i see that happening in the screenshot though..
im not sure i can help here.
if you can produce a simple code example on top of our demo apps that can reproduce this issue, then we can have a look