mirror of
https://github.com/logto-io/logto.git
synced 2025-01-06 20:40:08 -05:00
chore(console): update default app running port number from 1234 to 3000
This commit is contained in:
parent
ff151b2010
commit
5f7752c102
8 changed files with 40 additions and 40 deletions
|
@ -80,12 +80,12 @@ app.use(
|
|||
>
|
||||
|
||||
<Alert>
|
||||
In the following steps, we assume your app is running on <code>http://localhost:1234</code>.
|
||||
In the following steps, we assume your app is running on <code>http://localhost:3000</code>.
|
||||
</Alert>
|
||||
|
||||
### Configure Redirect URI
|
||||
|
||||
First, let’s enter your redirect URI. E.g. `http://localhost:1234/callback`.
|
||||
First, let’s enter your redirect URI. E.g. `http://localhost:3000/callback`.
|
||||
|
||||
<UriInputField appId={props.appId} isSingle={!props.isCompact} name="redirectUris" title="application_details.redirect_uri" />
|
||||
|
||||
|
@ -118,7 +118,7 @@ const { fromUint8Array } = require('js-base64');
|
|||
const config = {
|
||||
endpoint: '${props.endpoint}',
|
||||
appId: '${props.appId}',
|
||||
redirectUri: '${props.redirectUris[0] ?? 'http://localhost:1234/callback'}', // Configured in the previous step
|
||||
redirectUri: '${props.redirectUris[0] ?? 'http://localhost:3000/callback'}', // Configured in the previous step
|
||||
scopes: withReservedScopes().split(' '),
|
||||
};
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ const { fromUint8Array } = require('js-base64');
|
|||
const config = {
|
||||
endpoint: '${props.endpoint}',
|
||||
appId: '${props.appId}',
|
||||
redirectUri: '${props.redirectUris[0] ?? 'http://localhost:1234/callback'}', // 上一步配置过的 Redirect URI
|
||||
redirectUri: '${props.redirectUris[0] ?? 'http://localhost:3000/callback'}', // 上一步配置过的 Redirect URI
|
||||
scopes: withReservedScopes().split(' '),
|
||||
};
|
||||
|
||||
|
|
|
@ -74,12 +74,12 @@ const App = () => (
|
|||
>
|
||||
|
||||
<Alert>
|
||||
In the following steps, we assume your app is running on <code>http://localhost:1234</code>.
|
||||
In the following steps, we assume your app is running on <code>http://localhost:3000</code>.
|
||||
</Alert>
|
||||
|
||||
### Configure Redirect URI
|
||||
|
||||
First, let’s enter your redirect URI. E.g. `http://localhost:1234/callback`.
|
||||
First, let’s enter your redirect URI. E.g. `http://localhost:3000/callback`.
|
||||
|
||||
<UriInputField appId={props.appId} isSingle={!props.isCompact} name="redirectUris" title="application_details.redirect_uri" />
|
||||
|
||||
|
@ -101,7 +101,7 @@ const SignIn = () => {
|
|||
}
|
||||
|
||||
return (
|
||||
<button onClick={() => signIn('${props.redirectUris[0] ?? 'http://localhost:1234/callback'}')}>
|
||||
<button onClick={() => signIn('${props.redirectUris[0] ?? 'http://localhost:3000/callback'}')}>
|
||||
Sign In
|
||||
</button>
|
||||
);
|
||||
|
@ -111,7 +111,7 @@ const SignIn = () => {
|
|||
|
||||
### Handle redirect
|
||||
|
||||
We're almost there! In the last step, we use `http://localhost:1234/callback` as the Redirect URI, and now we need to handle it properly.
|
||||
We're almost there! In the last step, we use `http://localhost:3000/callback` as the Redirect URI, and now we need to handle it properly.
|
||||
|
||||
First let's create a callback component:
|
||||
|
||||
|
@ -149,7 +149,7 @@ Finally insert the code below to create a `/callback` route which does NOT requi
|
|||
|
||||
Calling `.signOut()` will clear all the Logto data in memory and localStorage if they exist.
|
||||
|
||||
After signing out, it'll be great to redirect user back to your website. Let's add `http://localhost:1234` as the Post Sign-out URI below, and use it as the parameter when calling `.signOut()`.
|
||||
After signing out, it'll be great to redirect user back to your website. Let's add `http://localhost:3000` as the Post Sign-out URI below, and use it as the parameter when calling `.signOut()`.
|
||||
|
||||
<UriInputField appId={props.appId} isSingle={!props.isCompact} name="postLogoutRedirectUris" title="application_details.post_sign_out_redirect_uri" />
|
||||
|
||||
|
@ -161,7 +161,7 @@ After signing out, it'll be great to redirect user back to your website. Let's a
|
|||
const { signOut } = useLogto();
|
||||
|
||||
return (
|
||||
<button onClick={() => signOut('${props.postLogoutRedirectUris[0] ?? 'http://localhost:1234'}')}>
|
||||
<button onClick={() => signOut('${props.postLogoutRedirectUris[0] ?? 'http://localhost:3000'}')}>
|
||||
Sign out
|
||||
</button>
|
||||
);
|
||||
|
|
|
@ -74,12 +74,12 @@ const App = () => (
|
|||
>
|
||||
|
||||
<Alert>
|
||||
在如下代码示例中, 我们均先假设你的 React 应用运行在 <code>http://localhost:1234</code> 上。
|
||||
在如下代码示例中, 我们均先假设你的 React 应用运行在 <code>http://localhost:3000</code> 上。
|
||||
</Alert>
|
||||
|
||||
### 配置 Redirect URI
|
||||
|
||||
首先,我们来添加 Redirect URI,如:`http://localhost:1234/callback`。
|
||||
首先,我们来添加 Redirect URI,如:`http://localhost:3000/callback`。
|
||||
|
||||
<UriInputField appId={props.appId} isSingle={!props.isCompact} name="redirectUris" title="application_details.redirect_uri" />
|
||||
|
||||
|
@ -101,7 +101,7 @@ const SignIn = () => {
|
|||
}
|
||||
|
||||
return (
|
||||
<button onClick={() => signIn('${props.redirectUris[0] ?? 'http://localhost:1234/callback'}')}>
|
||||
<button onClick={() => signIn('${props.redirectUris[0] ?? 'http://localhost:3000/callback'}')}>
|
||||
登录
|
||||
</button>
|
||||
);
|
||||
|
@ -111,7 +111,7 @@ const SignIn = () => {
|
|||
|
||||
### 处理重定向
|
||||
|
||||
马上就要大功告成!在上一步,我们将 `http://localhost:1234/callback` 用作 Redirect URI,现在我们需要对其妥善处理。
|
||||
马上就要大功告成!在上一步,我们将 `http://localhost:3000/callback` 用作 Redirect URI,现在我们需要对其妥善处理。
|
||||
|
||||
首先,让我们来创建一个 callback 组件:
|
||||
|
||||
|
@ -149,7 +149,7 @@ const Callback = () => {
|
|||
|
||||
调用 `.signOut()` 将清理内存与 localStorage 中的所有 Logto 数据(如果有)。
|
||||
|
||||
在退出登录后,让你的用户重新回到你的网站是个不错的选择。让我们将 `http://localhost:1234` 添加至下面的输入框,并将其作为调用 `.signOut()` 的参数。
|
||||
在退出登录后,让你的用户重新回到你的网站是个不错的选择。让我们将 `http://localhost:3000` 添加至下面的输入框,并将其作为调用 `.signOut()` 的参数。
|
||||
|
||||
<UriInputField appId={props.appId} isSingle={!props.isCompact} name="postLogoutRedirectUris" title="application_details.post_sign_out_redirect_uri" />
|
||||
|
||||
|
@ -161,7 +161,7 @@ const Callback = () => {
|
|||
const { signOut } = useLogto();
|
||||
|
||||
return (
|
||||
<button onClick={() => signOut('${props.postLogoutRedirectUris[0] ?? 'http://localhost:1234'}')}>
|
||||
<button onClick={() => signOut('${props.postLogoutRedirectUris[0] ?? 'http://localhost:3000'}')}>
|
||||
退出登录
|
||||
</button>
|
||||
);
|
||||
|
|
|
@ -68,12 +68,12 @@ const logtoClient = new LogtoClient({
|
|||
>
|
||||
|
||||
<Alert>
|
||||
In the following steps, we assume your app is running on <code>http://localhost:1234</code>.
|
||||
In the following steps, we assume your app is running on <code>http://localhost:3000</code>.
|
||||
</Alert>
|
||||
|
||||
### Configure Redirect URI
|
||||
|
||||
First, let’s enter your redirect URI. E.g. `http://localhost:1234/callback`.
|
||||
First, let’s enter your redirect URI. E.g. `http://localhost:3000/callback`.
|
||||
|
||||
<UriInputField appId={props.appId} isSingle={!props.isCompact} name="redirectUris" title="application_details.redirect_uri" />
|
||||
|
||||
|
@ -83,7 +83,7 @@ Go back to your IDE/editor, use the following code to implement the sign-in butt
|
|||
|
||||
<pre>
|
||||
<code className="language-html">
|
||||
{`<button onclick="logtoClient.signIn('${props.redirectUris[0] ?? 'http://localhost:1234/callback'}')">
|
||||
{`<button onclick="logtoClient.signIn('${props.redirectUris[0] ?? 'http://localhost:3000/callback'}')">
|
||||
Sign In
|
||||
</button>`}
|
||||
</code>
|
||||
|
@ -91,7 +91,7 @@ Go back to your IDE/editor, use the following code to implement the sign-in butt
|
|||
|
||||
### Handle redirect
|
||||
|
||||
We're almost there! In the last step, we use `http://localhost:1234/callback` as the Redirect URI, and now we need to handle it properly.
|
||||
We're almost there! In the last step, we use `http://localhost:3000/callback` as the Redirect URI, and now we need to handle it properly.
|
||||
|
||||
Insert the code below in your `/callback` route:
|
||||
|
||||
|
@ -118,7 +118,7 @@ Now you can test the sign-in flow.
|
|||
|
||||
Calling `.signOut()` will clear all the Logto data in memory and localStorage if they exist.
|
||||
|
||||
After signing out, it'll be great to redirect user back to your website. Let's add `http://localhost:1234` as the Post Sign-out URI below, and use it as the parameter when calling `.signOut()`.
|
||||
After signing out, it'll be great to redirect user back to your website. Let's add `http://localhost:3000` as the Post Sign-out URI below, and use it as the parameter when calling `.signOut()`.
|
||||
|
||||
<UriInputField appId={props.appId} isSingle={!props.isCompact} name="postLogoutRedirectUris" title="application_details.post_sign_out_redirect_uri" />
|
||||
|
||||
|
@ -126,7 +126,7 @@ After signing out, it'll be great to redirect user back to your website. Let's a
|
|||
|
||||
<pre>
|
||||
<code className="language-html">
|
||||
{`<button onclick="logtoClient.signOut('${props.postLogoutRedirectUris[0] ?? 'http://localhost:1234'}')">
|
||||
{`<button onclick="logtoClient.signOut('${props.postLogoutRedirectUris[0] ?? 'http://localhost:3000'}')">
|
||||
Sign Out
|
||||
</button>`}
|
||||
</code>
|
||||
|
|
|
@ -68,12 +68,12 @@ const logtoClient = new LogtoClient({
|
|||
>
|
||||
|
||||
<Alert>
|
||||
在如下代码示例中, 我们均先假设你的应用运行在 <code>http://localhost:1234</code> 上。
|
||||
在如下代码示例中, 我们均先假设你的应用运行在 <code>http://localhost:3000</code> 上。
|
||||
</Alert>
|
||||
|
||||
### 配置 Redirect URI
|
||||
|
||||
首先,我们来添加 redirect URI,如: `http://localhost:1234/callback`。
|
||||
首先,我们来添加 redirect URI,如: `http://localhost:3000/callback`。
|
||||
|
||||
<UriInputField appId={props.appId} isSingle={!props.isCompact} name="redirectUris" title="application_details.redirect_uri" />
|
||||
|
||||
|
@ -83,7 +83,7 @@ const logtoClient = new LogtoClient({
|
|||
|
||||
<pre>
|
||||
<code className="language-html">
|
||||
{`<button onclick="logtoClient.signIn('${props.redirectUris[0] ?? 'http://localhost:1234/callback'}')">
|
||||
{`<button onclick="logtoClient.signIn('${props.redirectUris[0] ?? 'http://localhost:3000/callback'}')">
|
||||
登录
|
||||
</button>`}
|
||||
</code>
|
||||
|
@ -91,7 +91,7 @@ const logtoClient = new LogtoClient({
|
|||
|
||||
### 处理重定向
|
||||
|
||||
马上就要大功告成!在上一步,我们将 `http://localhost:1234/callback` 用作 Redirect URI,现在我们需要对其妥善处理。
|
||||
马上就要大功告成!在上一步,我们将 `http://localhost:3000/callback` 用作 Redirect URI,现在我们需要对其妥善处理。
|
||||
|
||||
在你的 `/callback` 路由下插入如下代码:
|
||||
|
||||
|
@ -118,7 +118,7 @@ try {
|
|||
|
||||
调用 `.signOut()` 将清理内存与 localStorage 中的所有 Logto 数据(如果有)。
|
||||
|
||||
在退出登录后,让你的用户重新回到你的网站是个不错的选择。让我们将 `http://localhost:1234` 添加至下面的输入框,并将其作为调用 `.signOut()` 的参数。
|
||||
在退出登录后,让你的用户重新回到你的网站是个不错的选择。让我们将 `http://localhost:3000` 添加至下面的输入框,并将其作为调用 `.signOut()` 的参数。
|
||||
|
||||
<UriInputField appId={props.appId} isSingle={!props.isCompact} name="postLogoutRedirectUris" title="application_details.post_sign_out_redirect_uri" />
|
||||
|
||||
|
@ -126,7 +126,7 @@ try {
|
|||
|
||||
<pre>
|
||||
<code className="language-html">
|
||||
{`<button onclick="logtoClient.signOut('${props.postLogoutRedirectUris[0] ?? 'http://localhost:1234'}')">
|
||||
{`<button onclick="logtoClient.signOut('${props.postLogoutRedirectUris[0] ?? 'http://localhost:3000'}')">
|
||||
退出登录
|
||||
</button>`}
|
||||
</code>
|
||||
|
|
|
@ -77,12 +77,12 @@ app.mount("#app");`}
|
|||
>
|
||||
|
||||
<Alert>
|
||||
In the following steps, we assume your app is running on <code>http://localhost:1234</code>.
|
||||
In the following steps, we assume your app is running on <code>http://localhost:3000</code>.
|
||||
</Alert>
|
||||
|
||||
### Configure Redirect URI
|
||||
|
||||
First, let’s enter your redirect URI. E.g. `http://localhost:1234/callback`.
|
||||
First, let’s enter your redirect URI. E.g. `http://localhost:3000/callback`.
|
||||
|
||||
<UriInputField appId={props.appId} isSingle={!props.isCompact} name="redirectUris" title="application_details.redirect_uri" />
|
||||
|
||||
|
@ -98,7 +98,7 @@ Go back to your IDE/editor, use the following code to implement the sign-in butt
|
|||
import { useLogto } from "@logto/vue";
|
||||
|
||||
const { signIn, isAuthenticated } = useLogto();
|
||||
const onClickSignIn = () => signIn('${props.redirectUris[0] ?? 'http://localhost:1234/callback'}');
|
||||
const onClickSignIn = () => signIn('${props.redirectUris[0] ?? 'http://localhost:3000/callback'}');
|
||||
</script>`}
|
||||
</code>
|
||||
</pre>
|
||||
|
@ -116,7 +116,7 @@ Go back to your IDE/editor, use the following code to implement the sign-in butt
|
|||
|
||||
### Handle redirect
|
||||
|
||||
We're almost there! In the last step, we use `http://localhost:1234/callback` as the Redirect URI, and now we need to handle it properly.
|
||||
We're almost there! In the last step, we use `http://localhost:3000/callback` as the Redirect URI, and now we need to handle it properly.
|
||||
|
||||
First let's create a callback component:
|
||||
|
||||
|
@ -164,7 +164,7 @@ const router = createRouter({
|
|||
|
||||
Calling `.signOut()` will clear all the Logto data in memory and localStorage if they exist.
|
||||
|
||||
After signing out, it'll be great to redirect user back to your website. Let's add `http://localhost:1234` as the Post Sign-out URI below, and use it as the parameter when calling `.signOut()`.
|
||||
After signing out, it'll be great to redirect user back to your website. Let's add `http://localhost:3000` as the Post Sign-out URI below, and use it as the parameter when calling `.signOut()`.
|
||||
|
||||
<UriInputField appId={props.appId} isSingle={!props.isCompact} name="postLogoutRedirectUris" title="application_details.post_sign_out_redirect_uri" />
|
||||
|
||||
|
@ -176,7 +176,7 @@ After signing out, it'll be great to redirect user back to your website. Let's a
|
|||
import { useLogto } from "@logto/vue";
|
||||
|
||||
const { signOut } = useLogto();
|
||||
const onClickSignOut = () => signOut('${props.postLogoutRedirectUris[0] ?? 'http://localhost:1234'}');
|
||||
const onClickSignOut = () => signOut('${props.postLogoutRedirectUris[0] ?? 'http://localhost:3000'}');
|
||||
</script>`}
|
||||
</code>
|
||||
</pre>
|
||||
|
|
|
@ -77,12 +77,12 @@ app.mount("#app");`}
|
|||
>
|
||||
|
||||
<Alert>
|
||||
在如下代码示例中, 我们均先假设你的 Vue 应用运行在 <code>http://localhost:1234</code> 上。
|
||||
在如下代码示例中, 我们均先假设你的 Vue 应用运行在 <code>http://localhost:3000</code> 上。
|
||||
</Alert>
|
||||
|
||||
### 配置 Redirect URI
|
||||
|
||||
首先,我们来添加 Redirect URI,如:`http://localhost:1234/callback`。
|
||||
首先,我们来添加 Redirect URI,如:`http://localhost:3000/callback`。
|
||||
|
||||
<UriInputField appId={props.appId} isSingle={!props.isCompact} name="redirectUris" title="application_details.redirect_uri" />
|
||||
|
||||
|
@ -98,7 +98,7 @@ app.mount("#app");`}
|
|||
import { useLogto } from "@logto/vue";
|
||||
|
||||
const { signIn, isAuthenticated } = useLogto();
|
||||
const onClickSignIn = () => signIn('${props.redirectUris[0] ?? 'http://localhost:1234/callback'}');
|
||||
const onClickSignIn = () => signIn('${props.redirectUris[0] ?? 'http://localhost:3000/callback'}');
|
||||
</script>`}
|
||||
</code>
|
||||
</pre>
|
||||
|
@ -116,7 +116,7 @@ app.mount("#app");`}
|
|||
|
||||
### 处理重定向
|
||||
|
||||
马上就要大功告成!在上一步,我们将 `http://localhost:1234/callback` 用作 Redirect URI,现在我们需要对其妥善处理。
|
||||
马上就要大功告成!在上一步,我们将 `http://localhost:3000/callback` 用作 Redirect URI,现在我们需要对其妥善处理。
|
||||
|
||||
首先,让我们来创建一个 Callback 组件:
|
||||
|
||||
|
@ -164,7 +164,7 @@ const router = createRouter({
|
|||
|
||||
调用 `.signOut()` 将清理内存与 localStorage 中的所有 Logto 数据(如果有)。
|
||||
|
||||
在退出登录后,让你的用户重新回到你的网站是个不错的选择。让我们将 `http://localhost:1234` 添加至下面的输入框,并将其作为调用 `.signOut()` 的参数。
|
||||
在退出登录后,让你的用户重新回到你的网站是个不错的选择。让我们将 `http://localhost:3000` 添加至下面的输入框,并将其作为调用 `.signOut()` 的参数。
|
||||
|
||||
<UriInputField appId={props.appId} isSingle={!props.isCompact} name="postLogoutRedirectUris" title="application_details.post_sign_out_redirect_uri" />
|
||||
|
||||
|
@ -176,7 +176,7 @@ const router = createRouter({
|
|||
import { useLogto } from "@logto/vue";
|
||||
|
||||
const { signOut } = useLogto();
|
||||
const onClickSignOut = () => signOut('${props.postLogoutRedirectUris[0] ?? 'http://localhost:1234'}');
|
||||
const onClickSignOut = () => signOut('${props.postLogoutRedirectUris[0] ?? 'http://localhost:3000'}');
|
||||
</script>`}
|
||||
</code>
|
||||
</pre>
|
||||
|
|
Loading…
Reference in a new issue