Elysia Tools
Navigation
Authentication & Authorization
Passport.js local presentation mocks
Use invented display cards, a local teaching trace and lesson-state labels; no Passport authentication is implemented.
Samples
Entries inside this sample collection
Project a demo presentation card
Copy only id and label from an invented display fixture. This is not serialization of an authenticated user or a Passport callback.
function presentationCard(fixture) {
return { id: fixture.id, label: fixture.label };
}
const result = presentationCard({ id: 'demo-1', label: 'Reader', note: 'practice' });
console.log(JSON.stringify(result));Record a local teaching sequence
Append two fixed stage names to a new array. No middleware, request, session or authentication is invoked.
function teachingTrace() {
const trace = [];
trace.push('prepare');
trace.push('present');
return trace;
}
const result = teachingTrace();
console.log(JSON.stringify(result));Display a mock workflow state
Translate a local lesson state into a display label. Ready means the lesson card is ready, not that access was granted.
function lessonState(state) {
const labels = new Map([['pending', 'Waiting'], ['ready', 'Ready']]);
return labels.get(state) ?? 'Unknown';
}
const result = ['pending', 'ready', 'other'].map(lessonState);
console.log(JSON.stringify(result));Tools
Tools frequently paired with this sample
Related
Related sample collections
Related