mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 05:10:19 +08:00
Fix JWT token bugs.
This commit is contained in:
@ -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"),
|
||||
|
Reference in New Issue
Block a user