# solid.auth.trackSession doubt and Viade

**URL:** <https://forum.solidproject.org/t/solid-auth-tracksession-doubt-and-viade/2690>\
**Category:** Build a Solid App\
**Created:** [February 26, 2020, 5:39pm UTC](https://forum.solidproject.org/t/solid-auth-tracksession-doubt-and-viade/2690 "2020-02-26T17:39:33Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![AnaGciaSchz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/anagciaschz/32/2714_2.png) [@AnaGciaSchz](https://forum.solidproject.org/u/AnaGciaSchz)\
**Post date:** [February 26, 2020, 5:39pm UTC](https://forum.solidproject.org/t/solid-auth-tracksession-doubt-and-viade/2690/1 "2020-02-26T17:39:33Z")

</div>

¡Hi! I’m a student from the University of Oviedo and I’m working on a routes management app called “Viade” with my team.

This week we started to code and I tried to create the logic for a login page so I went by using the [Make a solid app on your lunch break](https://solid.inrupt.com/docs/app-on-your-lunch-break) tutorial but I encountered some problems.

The first problem was that the popup.htm file didn’t do anything. I searched for a solution and saw that I had to use a link for the “const popupUri” in main.js (you can see the code in the image at the end of the post).

The second problem was that when I tried to log out, the page didn’t change the interface. I thought that the problem was that I wasn’t logging out, but it seems that I was logging out and the solid.auth.trackSession wasn’t changing the interface.

I read about that method and I understood that when the session state changes it is invoked, but for some reason, it only works when I log in and don’t works when I log out.

Here is the code:

main,js

![main](https://europe1.discourse-cdn.com/flex017/uploads/solidproject/original/2X/b/bb3d24a481190efba892c1bba4c17ce430a211e4.png)

The rest of the files are the same from the tutorial (I would add more pictures, but I’m a new user and I can’t do it).

Also, here’s the link for the [viade app](https://github.com/Arquisoft/viade_es2c), we currently only have some documentation, but we will add the rest day by day.

Thank you for reading.

---

<div class="post-metadata">

**Author:** ![Smag0](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/smag0/32/310_2.png) [@Smag0](https://forum.solidproject.org/u/Smag0)\
**Post date:** [February 26, 2020, 5:56pm UTC](https://forum.solidproject.org/t/solid-auth-tracksession-doubt-and-viade/2690/2 "2020-02-26T17:56:24Z")

</div>

Hi @AnaGciaSchz and welcome, what gives you the code exemple of GitHub repo

solid.auth.trackSession(session =\> {  
if (!session)  
console.log(‘The user is not logged in’)  
else  
console.log(`The user is ${session.webId}`)  
})

Is it correct?

---

<div class="post-metadata">

**Author:** ![AnaGciaSchz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/anagciaschz/32/2714_2.png) [@AnaGciaSchz](https://forum.solidproject.org/u/AnaGciaSchz)\
**Post date:** [February 26, 2020, 7:45pm UTC](https://forum.solidproject.org/t/solid-auth-tracksession-doubt-and-viade/2690/3 "2020-02-26T19:45:16Z")

</div>

Hi @Smag0 😁

I used that code and it didn’t change the interface. However, I looked at the errors and warnings and It seems that I’m having an error on line 19 in the solid-auth-client.bundle.js:

 ![errores](https://europe1.discourse-cdn.com/flex017/uploads/solidproject/original/2X/f/fc50c32b2cce69ca8865874797d9cc1008d2e5a2.png)

It is the same file as in the tutorial. Maybe that’s why I can’t make my login page work properly

---

<div class="post-metadata">

**Author:** ![james.martin](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/james.martin/32/439_2.png) [@james.martin](https://forum.solidproject.org/u/james.martin)\
**Post date:** [February 26, 2020, 7:59pm UTC](https://forum.solidproject.org/t/solid-auth-tracksession-doubt-and-viade/2690/4 "2020-02-26T19:59:44Z")

</div>

I’ve seen this issue a few times - it’s actually the subject of a few closed bugs in solid-auth-client. Maybe this helps?

> <https://github.com/solid/solid-auth-client/issues/85>
>
> I've got a \[project set up\](https://github.com/JordanShurmer/psop) which loads s…olid-auth-client as an npm dependency. 
> 
> Any call to \`logout()\` or \`login()\` fails with a console error saying
> 
> \`\`\`
> webid-oidc.js:69 Error finding a WebID-OIDC session
> currentSession @ webid-oidc.js:69
> 
> webid-oidc.js:70 Error: Cannot find module '../algorithms/RSASSA-PKCS1-v1\_5'
> at webpackEmptyContext (algorithms sync:2)
> at SupportedAlgorithms.normalize (SupportedAlgorithms.js:84)
> at SubtleCrypto.importKey (SubtleCrypto.js:279)
> at RSASSA\_PKCS1\_v1\_5.importKey (RSASSA-PKCS1-v1\_5.js:124)
> at Function.importKey (JWA.js:113)
> at Function.importKey (JWK.js:46)
> at JWKSet.js:62
> at Array.map (\<anonymous\>)
> at Function.importKeys (JWKSet.js:61)
> at Function.from (RelyingParty.js:97)
> \`\`\`
> 
> If I replace the usage of the npm package with the bundled js at https://solid.github.io/solid-auth-client/dist/solid-auth-client.bundle.js then it works without a problem. You can see this working in the \[cdn-solid-auth branch\](https://github.com/JordanShurmer/psop/compare/cdn-solid-auth).

The solution there is to update your webpack configuration if you’re using it. Details in the comments.

If you’re not adverse to using React, the [React Generator](https://github.com/inrupt/generator-solid-react) is designed to scaffold a whole application wiring up all this stuff automatically for you (including layouts for private vs public, and handling login/logout for you)

---

<div class="post-metadata">

**Author:** ![Smag0](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/smag0/32/310_2.png) [@Smag0](https://forum.solidproject.org/u/Smag0)\
**Post date:** [February 26, 2020, 8:16pm UTC](https://forum.solidproject.org/t/solid-auth-tracksession-doubt-and-viade/2690/5 "2020-02-26T20:16:45Z")

</div>

For my recent project, i use the version that you can find here [https://github.com/scenaristeur/shighl/tree/master/dist/vendor](https://github.com/scenaristeur/shighl/tree/master/dist/vendor),  
Make sure you copy the bundle.js.map too at the same location as I see that you’ve got an error on it

---

<div class="post-metadata">

**Author:** ![Vincent](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@Vincent](https://forum.solidproject.org/u/Vincent)\
**Post date:** [February 27, 2020, 11:10am UTC](https://forum.solidproject.org/t/solid-auth-tracksession-doubt-and-viade/2690/6 "2020-02-27T11:10:18Z")

</div>

> [@AnaGciaSchz](#):
>
> This week we started to code and I tried to create the logic for a login page so I went by using the [Make a solid app on your lunch break](https://solid.inrupt.com/docs/app-on-your-lunch-break) tutorial but I encountered some problems.

Keep in mind that that tutorial is pretty old and doesn’t cover writing data to a Pod. For a more fundamental introduction to the concepts behind writing a Solid app, it might be a good idea to work your way through [the documentation on solidproject.org](https://solidproject.org/for-developers/apps/first-app) first.

(And let me know if things are unclear there.)

---

<div class="post-metadata">

**Author:** ![AnaGciaSchz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/anagciaschz/32/2714_2.png) [@AnaGciaSchz](https://forum.solidproject.org/u/AnaGciaSchz)\
**Post date:** [February 27, 2020, 4:49pm UTC](https://forum.solidproject.org/t/solid-auth-tracksession-doubt-and-viade/2690/7 "2020-02-27T16:49:54Z")

</div>

I tried to use it but I still receive the same “Cannot read property ‘importKey’ of undefined” and the “Error logging out” errors.

However, the “DevTools failed to parse SouceMap” error disappeared, so thank you for telling me that I needed the bundle.js.map file too 😀

---

<div class="post-metadata">

**Author:** ![AnaGciaSchz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/anagciaschz/32/2714_2.png) [@AnaGciaSchz](https://forum.solidproject.org/u/AnaGciaSchz)\
**Post date:** [February 27, 2020, 4:54pm UTC](https://forum.solidproject.org/t/solid-auth-tracksession-doubt-and-viade/2690/8 "2020-02-27T16:54:45Z")

</div>

I have not installed the library with npm, I’m using the .js file that the tutorial provided so I don’t have a webpack.common.config.js file to change (or maybe I can’t find where that configuration is).

And thank you for the generator, We are going to use React for Viade so you have helped us so much 😁 I’m going straight away to use it

---

<div class="post-metadata">

**Author:** ![AnaGciaSchz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/anagciaschz/32/2714_2.png) [@AnaGciaSchz](https://forum.solidproject.org/u/AnaGciaSchz)\
**Post date:** [February 27, 2020, 4:56pm UTC](https://forum.solidproject.org/t/solid-auth-tracksession-doubt-and-viade/2690/9 "2020-02-27T16:56:38Z")

</div>

Yeah, they recommended me that tutorial, I’m going to try to do it 🤔
