solid-contrib / solid-auth-fetcher

A client library for authenticating with Solid
Other
2 stars 7 forks source link

example/server is out of date? #8

Closed michielbdejong closed 4 years ago

michielbdejong commented 4 years ago

When trying to run the server example:


loopy:solid-auth-fetcher michiel$ cd examples/server/
loopy:server michiel$ npm run dev

> solid-auth-fetcher-node-example@1.0.0 dev /Users/michiel/gh/solid/solid-auth-fetcher/examples/server
> ts-node-dev src/server.ts

Using ts-node version 8.10.2, typescript version 3.9.6
Compilation error in /Users/michiel/gh/solid/solid-auth-fetcher/examples/server/src/server.ts
[ERROR] 11:33:17 ⨯ Unable to compile TypeScript:
src/server.ts:7:34 - error TS2307: Cannot find module 'solid-auth-fetcher/dist/neededAction/INeededRedirectAction' or its corresponding type declarations.

7 import INeedeRedirectAction from "solid-auth-fetcher/dist/neededAction/INeededRedirectAction";
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/server.ts:67:39 - error TS2339: Property 'webId' does not exist on type 'ISolidSession'.
  Property 'webId' does not exist on type 'ILoggedOutSolidSession'.

67     sessions[req.session.localUserId].webId
                                         ~~~~~
src/server.ts:70:48 - error TS2339: Property 'webId' does not exist on type 'ISolidSession'.
  Property 'webId' does not exist on type 'ILoggedOutSolidSession'.

70       webId: sessions[req.session.localUserId].webId,
                                                  ~~~~~
src/server.ts:83:39 - error TS2339: Property 'webId' does not exist on type 'ISolidSession'.
  Property 'webId' does not exist on type 'ILoggedOutSolidSession'.

83     sessions[req.session.localUserId].webId
                                         ~~~~~
src/server.ts:87:25 - error TS2339: Property 'fetch' does not exist on type 'ISolidSession'.
  Property 'fetch' does not exist on type 'ILoggedOutSolidSession'.

87     ] as ISolidSession).fetch("http://localhost:10100/", {});
                           ~~~~~
src/server.ts:89:48 - error TS2339: Property 'webId' does not exist on type 'ISolidSession'.
  Property 'webId' does not exist on type 'ILoggedOutSolidSession'.

89       webId: sessions[req.session.localUserId].webId,
                                                  ~~~~~
src/server.ts:102:39 - error TS2339: Property 'webId' does not exist on type 'ISolidSession'.
  Property 'webId' does not exist on type 'ILoggedOutSolidSession'.

102     sessions[req.session.localUserId].webId
                                          ~~~~~
src/server.ts:104:45 - error TS2339: Property 'logout' does not exist on type 'ISolidSession'.
  Property 'logout' does not exist on type 'ILoggedOutSolidSession'.

104     await sessions[req.session.localUserId].logout();
                                                ~~~~~~
michielbdejong commented 4 years ago

The server example seems out of date. Will look at rewriting it once I have a better understanding of the code.