aboutsummaryrefslogtreecommitdiffstats
path: root/resources/src/mediawiki.authenticationPopup
Commit message (Collapse)AuthorAgeFilesLines
* JSDoc: fix some eslint warningsNovem Linguae2024-07-011-1/+2
| | | | | Bug: T356455 Change-Id: Id0296c6bd464a868a9dc9624a5d4b61f5372fb7b
* ESLint: Enforce prefer-arrow-callback and autofixEd Sanders2024-06-112-2/+2
| | | | Change-Id: Iddfa574e42e569ac5e2a2b098ad2f11ca80c5955
* build: Update eslint-config-wikimedia to 0.28.1 and autofixEd Sanders2024-06-111-3/+1
| | | | | | | Also remove temporary explicit dependency on eslint-plugin-vue introduced in Ibd616750f046a. Change-Id: Ic6330fcb116e99d5827b4877e094e3073e2b7b72
* Add JSDoc for mediawiki.authenticationPopup moduleBartosz Dziewoński2024-05-302-0/+49
| | | | | | | Follow-up to b18e4b3517d605fbabe375bf42a6bff4625f5c18. Bug: T364939 Change-Id: Ifa3283227515ff2ad78008249ea0075dbc279873
* Add library to display the login form in a JavaScript modal dialogBartosz Dziewoński2024-05-287-0/+572
Experimental library that can display the login form in a small browser popup window, a new browser tab or window, or an iframe in a modal message dialog. We're still testing which of these methods work from the technical side, and which are understandable for users. Some methods or the whole library may be removed in the future. Usage: const authPopup = require( 'mediawiki.authenticationPopup' ); authPopup.startPopupWindow() // or: authPopup.startNewTabOrWindow() // or: authPopup.startIframe() .then( function ( userinfo ) { if ( userinfo ) { // Logged in } else { // Cancelled by the user } }, function ( error ) { // Unexpected error stopped the login process } ); Or in future JS: const userinfo = await authPopup.startPopupWindow(); // etc. if ( userinfo ) { // Logged in } else { // Cancelled by the user } In all three methods, the popup opens the login form with &display=popup and with &returnto pointing to an unlisted special page that communicates with the module on the parent page. Once the library is stable, the AuthPopup component may be separated from MediaWiki and released as its own package, to be used by tools to open MediaWiki OAuth workflows in a similar way. Bug: T364939 Change-Id: I08d9c799b8f79ebab2bcf4fcf330ee8eb995582e