mirror of
https://github.com/stackblitz/bolt.new
synced 2025-02-05 20:46:43 +00:00
quick fix
This commit is contained in:
parent
90847e7cb6
commit
21bfcfcec4
@ -3,6 +3,12 @@ import { toast } from 'react-toastify';
|
|||||||
import Cookies from 'js-cookie';
|
import Cookies from 'js-cookie';
|
||||||
import { logStore } from '~/lib/stores/logs';
|
import { logStore } from '~/lib/stores/logs';
|
||||||
|
|
||||||
|
interface GitHubUserResponse {
|
||||||
|
login: string;
|
||||||
|
id: number;
|
||||||
|
[key: string]: any; // for other properties we don't explicitly need
|
||||||
|
}
|
||||||
|
|
||||||
export default function ConnectionsTab() {
|
export default function ConnectionsTab() {
|
||||||
const [githubUsername, setGithubUsername] = useState(Cookies.get('githubUsername') || '');
|
const [githubUsername, setGithubUsername] = useState(Cookies.get('githubUsername') || '');
|
||||||
const [githubToken, setGithubToken] = useState(Cookies.get('githubToken') || '');
|
const [githubToken, setGithubToken] = useState(Cookies.get('githubToken') || '');
|
||||||
@ -26,7 +32,7 @@ export default function ConnectionsTab() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
const data = await response.json();
|
const data = (await response.json()) as GitHubUserResponse;
|
||||||
if (data.login === githubUsername) {
|
if (data.login === githubUsername) {
|
||||||
setIsConnected(true);
|
setIsConnected(true);
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user