修复通用 OAuth 弹窗登录与账号关联并隔离迟到结果
This commit is contained in:
1 parent
d330ad01cc
commit
e27f08e36e
5 files changed
+690
-78
No files matched your search
@@ -1,11 +1,10 @@
|
||||
<script>
|
||||
/** 根据站点 oauth 配置显示第三方登录入口;启动跳转及错误处理复用 useOAuth。 */
|
||||
/** 根据站点 oauth 配置显示第三方登录入口;弹窗授权与结果确认复用 useOAuth。 */
|
||||
import "~/assets/styles/GenericOAuthProviders.Bv8oNwXP.css";
|
||||
import { toDisplayString } from "vue";
|
||||
import { renderList } from "vue";
|
||||
import { onMounted } from "vue";
|
||||
import { createBlock } from "vue";
|
||||
import { ref } from "vue";
|
||||
import { withCtx } from "vue";
|
||||
import { createCommentVNode } from "vue";
|
||||
import { computed } from "vue";
|
||||
@@ -15,7 +14,6 @@ import { createTextVNode } from "vue";
|
||||
import { unref } from "vue";
|
||||
import { defineComponent } from "vue";
|
||||
import { openBlock } from "vue";
|
||||
import { NuxtLink } from "#components";
|
||||
import { t as useSiteConfig_t } from "~/lib/useSiteConfig.js";
|
||||
import button from "openvue/button";
|
||||
import { t as _plugin_vue_export_helper_t } from "~/lib/_plugin-vue_export-helper.js";
|
||||
@@ -38,22 +36,15 @@ var x = {
|
||||
setup(f) {
|
||||
let _ = useSiteConfig_t(),
|
||||
w = computed(() => oauth_t(_.config.value?.oauth)),
|
||||
{ busy: T, error: E, start: D } = useOAuth_t(),
|
||||
O = ref(!1);
|
||||
{ busy: T, error: E, start: D } = useOAuth_t();
|
||||
return (
|
||||
onMounted(() => {
|
||||
_.load();
|
||||
try {
|
||||
// 只读取浏览器会话中的待完成提示,不将该标志当作登录身份或授权凭证。
|
||||
O.value =
|
||||
sessionStorage.getItem(`console-oauth-pending`) === `1`;
|
||||
} catch {}
|
||||
}),
|
||||
(n, i) => {
|
||||
let s = button,
|
||||
f = message,
|
||||
h = NuxtLink;
|
||||
return unref(w).length || unref(O)
|
||||
f = message;
|
||||
return unref(w).length
|
||||
? (openBlock(),
|
||||
createElementBlock(`div`, x, [
|
||||
unref(w).length
|
||||
@@ -126,27 +117,6 @@ var x = {
|
||||
},
|
||||
))
|
||||
: createCommentVNode(``, !0),
|
||||
unref(O)
|
||||
? (openBlock(),
|
||||
createBlock(
|
||||
h,
|
||||
{
|
||||
key: 2,
|
||||
to: `/oauth/callback`,
|
||||
},
|
||||
{
|
||||
default: withCtx(() => [
|
||||
...(i[0] ||= [
|
||||
createTextVNode(
|
||||
`已完成第三方授权?继续登录`,
|
||||
-1,
|
||||
),
|
||||
]),
|
||||
]),
|
||||
_: 1,
|
||||
},
|
||||
))
|
||||
: createCommentVNode(``, !0),
|
||||
]))
|
||||
: createCommentVNode(``, !0);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user