1.0.2 • Published 4 years ago

moodle3session v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

moodle3session

moodle3session is a module allowing to obtain a moodle session cookie for moodle3 instances. With that cookie it is possible to act like a real logged in user.

Installation

npm install moodle3session --save
yarn add moodle3session
bower install moodle3session --save

Usage

To get a moodle session you have to create a new MoodleSession object...

const moodle3session = require('moodle3session');
const session = new moodle3session.MoodleSession('https://moodle.mysite.de');
...

const moodleSession = await session.obtainMoodleSession('Username', 'Password'); // string
const stillValid = await session.isValid(moodleSession); // boolean