-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Process CentralAuth redirects on new lexeme as TempUser
With T357024, the API will return a URL initialized by CentralAuth when a TempUser tries to create a new lexeme. We need to redirect to this URL instead of the new lexeme (the URL will then redirect to the new lexeme once it’s finished setting up the temporary account). Bug: T357152
- Loading branch information
Showing
20 changed files
with
143 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
( function () { | ||
// eslint-disable-next-line no-console | ||
console.warn = function () { | ||
console.warn = function ( _message ) { | ||
// ignore @vue/compat warnings | ||
}; | ||
}() ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/plugins/UrlLauncherPlugin/BrowserRedirectingUrlLauncher.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import UrlLauncher from './UrlLauncher'; | ||
|
||
/** | ||
* The plugin performs a redirect away from the current | ||
* page. It returns a promise that never returns, because | ||
* the browser window reloads. In test contexts, this | ||
* can be stubbed to make assertions about the target | ||
* URL. | ||
*/ | ||
export default class BrowserRedirectingUrlLauncher implements UrlLauncher { | ||
public goToURL( url: URL ): Promise<never> { | ||
window.location.href = url.toString(); | ||
return new Promise( ( _resolve ) => { | ||
// never resolve | ||
} ); | ||
} | ||
} |
16 changes: 8 additions & 8 deletions
16
src/plugins/WikiRouterPlugin/WikiRouter.ts → src/plugins/UrlLauncherPlugin/UrlLauncher.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
import { inject, InjectionKey } from 'vue'; | ||
|
||
export default interface WikiRouter { | ||
export default interface UrlLauncher { | ||
/** | ||
* Go to the wiki page with the given title. | ||
* Go to the target URL | ||
* | ||
* @param title The title (with namespace, if any). | ||
* @param target The target URL. | ||
* @return A Promise that does not resolve until the navigation is finished. | ||
* A real implementation should never resolve the promise, | ||
* because by the time navigation finishes, | ||
* the page that called this function will no longer be executing JavaScript. | ||
* However, a dev implementation may resolve the promise. | ||
*/ | ||
goToTitle( title: string ): Promise<void>; | ||
goToURL( target: URL ): Promise<void>; | ||
} | ||
|
||
export const WikiRouterKey: InjectionKey<WikiRouter> = Symbol( 'WikiRouter' ); | ||
export const UrlLauncherKey: InjectionKey<UrlLauncher> = Symbol( 'UrlLauncher' ); | ||
|
||
export function useWikiRouter(): WikiRouter { | ||
return inject( WikiRouterKey, () => { | ||
throw new Error( 'No WikiRouter provided!' ); | ||
export function useUrlLauncher(): UrlLauncher { | ||
return inject( UrlLauncherKey, () => { | ||
throw new Error( 'No UrlLauncher provided!' ); | ||
}, true ); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.