LearnersBlock / learners-block

Provide educational resources, websites and popular EdTech (Kolibri, Moodle) offline.
https://learnersblock.org
GNU General Public License v3.0
12 stars 1 forks source link

Update File Manager auth endpoints and language setting #90

Closed maggie44 closed 3 years ago

maggie44 commented 3 years ago

There is a cookie stored on login with a JWT Token and some new endpoints on Controller for authentication. Goal here is to get File Manager to point to it and use it for auth as a new backend. At the moment the token is both in local storage and session storage.

There is also a cookie called lang that will appear when someone sets the language for the interface. Looking to have File Manager read from that to dictate the language too. Note that default language is en-us now, rather than 'en'. Would be good for it to treat the two as the same.

Auth routes (although realise that not all will be needed for this) are:

'/v1/login'
'/v1/logout'
'/v1/setpassword'
'/v1/verifylogin'

Related to: https://github.com/LearnersBlock/learners-block/issues/73 Related to: https://github.com/LearnersBlock/learners-block/issues/7

maggie44 commented 3 years ago

When visiting the URL, FileManager will need to open the system folder as outlined below:

Settings panel:

/files-upload = /app/web/public/storage/ /upload-website = /app/web/public/storage/website

User interface:

/files = /app/web/public/storage/fileshare /library = /app/web/public/storage/library /makerspace = /app/web/public/storage/makerspace

Each route to the File Manager will have its own path (i.e /files; /library; or /makerspace) even through they all point to the same IFM file. The path used (such as /library) can then be read by IFM to make a decision on what the root system path it should show should be, rather than having to pass the with /?path=etcetc.

maximilianoertel commented 3 years ago

@maggie0002 just to be sure I entirely understand what you're trying to achieve, can you please confirm the points below for me?

1) /files, /upload-website, /library and /makerspace should all point to the file manager but load a different file root directory based on the URL and whether or not you're accessing those as an authenticated admin, correct?

2) Have you already configured NGINX to handle the routing or does this still needs to be done as part of this ticket?

maggie44 commented 3 years ago
  1. Yes. Authentication is also about permissions to those paths as well of course.
  2. NGINX file already has those routes in it. And interface points to those paths

There is also the language cookie and not sure if I added that to another ticket.