{t('description.not_you')}{' '}
diff --git a/packages/experience/src/pages/Consent/util.test.ts b/packages/experience/src/pages/Consent/util.test.ts
new file mode 100644
index 000000000..9b069ad89
--- /dev/null
+++ b/packages/experience/src/pages/Consent/util.test.ts
@@ -0,0 +1,15 @@
+import { getRedirectUriOrigin } from './util';
+
+describe('consent page utils', () => {
+ it('getRedirectUriOrigin should return the origin if the redirectUri is a http url', () => {
+ const redirectUri = 'https://logto.io/callback?code=123';
+ const origin = getRedirectUriOrigin(redirectUri);
+ expect(origin).toEqual('https://logto.io');
+ });
+
+ it('getRedirectUriOrigin should return the original uri if the redirectUri is not a http url', () => {
+ const redirectUri = 'io.logto://callback?code=123';
+ const origin = getRedirectUriOrigin(redirectUri);
+ expect(origin).toEqual(redirectUri);
+ });
+});
diff --git a/packages/experience/src/pages/Consent/util.ts b/packages/experience/src/pages/Consent/util.ts
new file mode 100644
index 000000000..eb4aaf884
--- /dev/null
+++ b/packages/experience/src/pages/Consent/util.ts
@@ -0,0 +1,17 @@
+/**
+ * We need to hide the query params and path from the redirectUri for security reasons when displaying it to the user.
+ *
+ * if the redirectUri is a http url, we should return the origin
+ * Otherwise return the original uri. e.g. native schema io.logto://callback
+ */
+export const getRedirectUriOrigin = (redirectUri: string) => {
+ const url = new URL(redirectUri);
+
+ // If the redirectUri is a http url, we should return the origin
+ if (url.protocol.startsWith('http')) {
+ return url.origin;
+ }
+
+ // Otherwise return the original uri. e.g. native schema io.logto://callback
+ return redirectUri;
+};