mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
fix(plugin): 🐛 Don't incorrectly call errorSearchParams before initialization in callback
This commit is contained in:
parent
a265e9df41
commit
d000914f61
2 changed files with 22 additions and 13 deletions
|
|
@ -91,7 +91,19 @@ export default (plugin: PluginType) => {
|
|||
flowId,
|
||||
currentUrl,
|
||||
redirectUrl,
|
||||
(error, message) => {
|
||||
(error, message, flow) => {
|
||||
const errorSearchParams = new URLSearchParams(
|
||||
Object.entries({
|
||||
redirect_uri: flow?.application?.redirectUri,
|
||||
client_id: flow?.application?.clientId,
|
||||
response_type: "code",
|
||||
scope: flow?.application?.scopes,
|
||||
}).filter(([_, value]) => value !== undefined) as [
|
||||
string,
|
||||
string,
|
||||
][],
|
||||
);
|
||||
|
||||
errorSearchParams.append("error", error);
|
||||
errorSearchParams.append("error_description", message);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue