get redirect_uri from get_tokens_url_params

This commit is contained in:
Gabriel Rosa
2022-06-15 10:08:03 -03:00
parent 2ff2aa049f
commit 3bb014e714
+13 -3
View File
@@ -218,9 +218,18 @@ export class InputsClientService implements OnModuleInit {
...secrets,
...credentials,
});
const get_tokens_url_params_obj = JSON.parse(
get_tokens_url_params_string,
);
let get_tokens_url_params_obj: Record<string, any> = {};
try {
get_tokens_url_params_obj = JSON.parse(
get_tokens_url_params_string,
);
} catch (error) {
throw new HttpException(
'Erro transformando get_tokens_url_params',
400,
);
}
const { redirect_uri } = get_tokens_url_params_obj;
for (const key in get_tokens_url_params_obj) {
const value = get_tokens_url_params_obj[key];
requestParams.append(key, value);
@@ -238,6 +247,7 @@ export class InputsClientService implements OnModuleInit {
const responseKey = get_tokens_set_response[key];
credentialsTokens[key] = data[responseKey];
}
redirect_uri.redirect_uri = redirect_uri;
}
break;
}