productdevbook
12/12/2022, 6:45 AMError: No instance of Session found. Make sure to call the Session.init method.
nkshah2
12/12/2022, 6:46 AMproductdevbook
12/12/2022, 6:48 AMonGithubPressed
sattvikc
12/12/2022, 6:51 AMproductdevbook
12/12/2022, 6:58 AMconst response = await ThirdPartyEmailPassword.thirdPartySignInAndUp({})
console.log(response.fetchResponse)
response.status
and samenkshah2
12/12/2022, 7:01 AMproductdevbook
12/12/2022, 7:02 AMts
<script lang="ts" setup>
import ThirdPartyEmailPassword from 'supertokens-web-js/recipe/thirdpartyemailpassword'
onMounted(async () => {
await ThirdPartyEmailPassword.thirdPartySignInAndUp({}).then((res) => {
console.log(res)
}).catch((err) => {
console.log(err)
})
})
</script>
console.log emptynkshah2
12/12/2022, 7:02 AM.then
does not work with async await, you can either use async await or .then
onMounted(async () => {
const response = await ThirdPartyEmailPassword.thirdPartySignInAndUp({})
console.log(response)
})
productdevbook
12/12/2022, 7:03 AMnkshah2
12/12/2022, 7:04 AMproductdevbook
12/12/2022, 7:04 AMts
<script lang="ts" setup>
import ThirdPartyEmailPassword from 'supertokens-web-js/recipe/thirdpartyemailpassword'
onMounted(async () => {
const response = await ThirdPartyEmailPassword.thirdPartySignInAndUp({})
console.log(response)
})
</script>
auth/callback/[provider].vuenkshah2
12/12/2022, 7:05 AMproductdevbook
12/12/2022, 7:06 AMnkshah2
12/12/2022, 7:07 AMproductdevbook
12/12/2022, 7:08 AMnkshah2
12/12/2022, 7:08 AMproductdevbook
12/12/2022, 7:08 AMsattvikc
12/12/2022, 7:09 AMnkshah2
12/12/2022, 7:11 AMconst response = await ThirdPartyEmailPassword.thirdPartySignInAndUp({})
this lineproductdevbook
12/12/2022, 7:12 AMts
onMounted(async () => {
console.log('mounted')
const response = await ThirdPartyEmailPassword.thirdPartySignInAndUp({})
console.log(response)
})
nkshah2
12/12/2022, 7:13 AMtry {
const response = await ThirdPartyEmailPassword.thirdPartySignInAndUp({})
console.log(response)
} catch(e) {
console.log(e)
}
Try changing it to this and see if it logs anythingproductdevbook
12/12/2022, 7:20 AMnkshah2
12/12/2022, 7:20 AMproductdevbook
12/12/2022, 7:20 AMts
import SuperTokens from 'supertokens-web-js'
import Session from 'supertokens-web-js/recipe/session'
import ThirdPartyEmailPassword from 'supertokens-web-js/recipe/thirdpartyemailpassword'
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.hook('app:mounted', () => {
SuperTokens.init({
appInfo: {
apiDomain: 'http://localhost:3001',
apiBasePath: '/auth',
appName: 'aaa',
},
recipeList: [
Session.init(),
ThirdPartyEmailPassword.init(),
],
})
})
})
page:finish -> app:mounted
nkshah2
12/12/2022, 7:21 AMproductdevbook
12/12/2022, 7:23 AMts
async function callAPI() {
const response = await fetch(`${apiDomain}/sessioninfo`)
if (response.status === 401) {
// this means that the session has expired and the
// user needs to relogin.
window.location.assign('/auth')
return
}
const json = await response.json()
window.alert(`Session Information:\n${JSON.stringify(json, null, 2)}`)
}
your vue github add but empty datankshah2
12/12/2022, 8:11 AM