mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 12:30:19 +08:00
Fix JWT token bugs.
This commit is contained in:
@ -8,6 +8,7 @@
|
||||
"@testing-library/react": "^9.3.2",
|
||||
"@testing-library/user-event": "^7.1.2",
|
||||
"antd": "^4.7.2",
|
||||
"copy-to-clipboard": "^3.3.1",
|
||||
"i18next": "^19.8.9",
|
||||
"moment": "^2.29.1",
|
||||
"react": "^16.14.0",
|
||||
|
@ -17,6 +17,7 @@ import React from "react";
|
||||
import {isMobile as isMobileDevice} from "react-device-detect";
|
||||
import "./i18n";
|
||||
import i18next from "i18next";
|
||||
import copy from "copy-to-clipboard";
|
||||
|
||||
export let ServerUrl = "";
|
||||
|
||||
@ -151,3 +152,14 @@ export function changeLanguage(language) {
|
||||
i18next.changeLanguage(language)
|
||||
window.location.reload(true);
|
||||
}
|
||||
|
||||
export function getClickable(text) {
|
||||
return (
|
||||
<a onClick={() => {
|
||||
copy(text);
|
||||
showMessage("success", `Copied to clipboard`);
|
||||
}}>
|
||||
{text}
|
||||
</a>
|
||||
)
|
||||
}
|
||||
|
@ -130,6 +130,9 @@ class TokenListPage extends React.Component {
|
||||
key: 'code',
|
||||
// width: '150px',
|
||||
sorter: (a, b) => a.code.localeCompare(b.code),
|
||||
render: (text, record, index) => {
|
||||
return Setting.getClickable(text);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: i18next.t("token:Access Token"),
|
||||
@ -137,6 +140,10 @@ class TokenListPage extends React.Component {
|
||||
key: 'accessToken',
|
||||
// width: '150px',
|
||||
sorter: (a, b) => a.accessToken.localeCompare(b.accessToken),
|
||||
ellipsis: true,
|
||||
render: (text, record, index) => {
|
||||
return Setting.getClickable(text);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: i18next.t("token:Expires In"),
|
||||
|
@ -3387,6 +3387,13 @@ copy-to-clipboard@^3.2.0:
|
||||
dependencies:
|
||||
toggle-selection "^1.0.6"
|
||||
|
||||
copy-to-clipboard@^3.3.1:
|
||||
version "3.3.1"
|
||||
resolved "https://registry.npmjs.org/copy-to-clipboard/-/copy-to-clipboard-3.3.1.tgz#115aa1a9998ffab6196f93076ad6da3b913662ae"
|
||||
integrity sha512-i13qo6kIHTTpCm8/Wup+0b1mVWETvu2kIMzKoK8FpkLkFxlt0znUAHcMzox+T8sPlqtZXq3CulEjQHsYiGFJUw==
|
||||
dependencies:
|
||||
toggle-selection "^1.0.6"
|
||||
|
||||
core-js-compat@^3.6.2:
|
||||
version "3.6.5"
|
||||
resolved "https://registry.npm.taobao.org/core-js-compat/download/core-js-compat-3.6.5.tgz#2a51d9a4e25dfd6e690251aa81f99e3c05481f1c"
|
||||
|
Reference in New Issue
Block a user