UX: allow to share login tokens via QR-code for educational context

This commit is contained in:
Pieter Vander Vennet 2025-05-29 23:26:59 +02:00
parent 93c613aa89
commit a90387c4f3
6 changed files with 123 additions and 48 deletions

View file

@ -14,6 +14,9 @@ import LanguageUtils from "../../Utils/LanguageUtils"
import LanguagePicker from "../InputElement/LanguagePicker.svelte"
import PendingChangesIndicator from "../BigComponents/PendingChangesIndicator.svelte"
import { Utils } from "../../Utils"
import { Feature } from "geojson"
import LayerConfig from "../../Models/ThemeConfig/LayerConfig"
import QrCode from "../Popup/QrCode.svelte"
export class SettingsVisualisations {
public static initList(): SpecialVisualizationSvelte[] {
@ -146,6 +149,21 @@ export class SettingsVisualisations {
})
},
},
{
funcName: "qr_login",
args: [],
docs: "A QR-code which shares the current URL and adds the login token. Anyone with this login token will have the same permissions as you currently have. Logging out from this session will also log them out",
group: "settings",
constr(state: SpecialVisualizationState, tags: UIEventSource<Record<string, string>>, argument: string[], feature: Feature, layer: LayerConfig): SvelteUIElement {
const shared_oauth_cookie = state.osmConnection.getToken()
return new SvelteUIElement(QrCode, {
state,
tags,
feature,
extraUrlParams: { shared_oauth_cookie }
})
}
},
{
funcName: "logout",