diff --git a/apps/frontend/src/components/launches/continue.integration.tsx b/apps/frontend/src/components/launches/continue.integration.tsx index 2b3f5c6f..b4ee3e96 100644 --- a/apps/frontend/src/components/launches/continue.integration.tsx +++ b/apps/frontend/src/components/launches/continue.integration.tsx @@ -41,11 +41,7 @@ export const ContinueIntegration: FC<{ // Helper to handle navigation - redirects if logged or returnURL exists, otherwise shows inline const navigateOrShow = useCallback( - ( - path: string, - returnURL: string | undefined, - successMessage: string - ) => { + (path: string, returnURL: string | undefined, successMessage: string) => { if (returnURL) { // If returnURL exists, always redirect to it with the path params const params = path.includes('?') ? path.split('?')[1] : ''; @@ -61,6 +57,13 @@ export const ContinueIntegration: FC<{ [logged, push] ); const modifiedParams = useMemo(() => { + if (provider === 'mewe') { + return { + state: searchParams.state || '', + code: searchParams.loginRequestToken || '', + refresh: searchParams.refresh || '', + }; + } if (provider === 'x') { return { state: searchParams.oauth_token || '', @@ -79,9 +82,7 @@ export const ContinueIntegration: FC<{ if (provider === 'mewe') { const hash = - typeof window !== 'undefined' - ? window.location.hash.substring(1) - : ''; + typeof window !== 'undefined' ? window.location.hash.substring(1) : ''; const hashParams = new URLSearchParams(hash); return { state: hashParams.get('state') || searchParams.state || '', @@ -139,7 +140,9 @@ export const ContinueIntegration: FC<{ data.status !== HttpStatusCode.Created ) { const errorData = await data.json().catch(() => ({})); - setErrorMessage(errorData.message || errorData.msg || 'Could not add provider'); + setErrorMessage( + errorData.message || errorData.msg || 'Could not add provider' + ); setError(true); return; } diff --git a/libraries/nestjs-libraries/src/integrations/social/mewe.provider.ts b/libraries/nestjs-libraries/src/integrations/social/mewe.provider.ts index 07e2e675..4fc27a35 100644 --- a/libraries/nestjs-libraries/src/integrations/social/mewe.provider.ts +++ b/libraries/nestjs-libraries/src/integrations/social/mewe.provider.ts @@ -272,7 +272,6 @@ export class MeweProvider extends SocialAbstract implements SocialProvider { if (!postResponse.ok) { const errorText = await postResponse.text(); - console.log(errorText); const handleError = this.handleErrors(errorText); if (handleError) { throw new Error(handleError.value); @@ -280,15 +279,9 @@ export class MeweProvider extends SocialAbstract implements SocialProvider { throw new Error('Failed to create MeWe post'); } - let postId = ''; - try { - const responseData = await postResponse.json(); - postId = responseData.postId || responseData.id || makeId(12); - } catch { - postId = makeId(12); - } + const postId = makeId(12); - const releaseURL = `${this.meweHost}/post/show/${postId}`; + const releaseURL = postType === 'timeline' ? `https://mewe.com/${integration.profile}/posts` : `https://mewe.com/group/${firstPost.settings.group}`; return [ {