PostgreSQL backup tool with Point-In-Time-Recovery and restore verification
TypeScript backupbackupsdatabasedatabase-backupdevopsdockergolangkubernetesmariadbmongodbmysqlpgpostgrespostgresqls3self-hostedsystem-administrationtoolsweb-ui
import { GithubOutlined } from '@ant-design/icons';
import { Button, message } from 'antd';
import { useTranslation } from 'react-i18next';
import { GITHUB_CLIENT_ID, getOAuthRedirectUri } from '../../../../constants';
export function GithubOAuthComponent() {
const { t } = useTranslation();
if (!GITHUB_CLIENT_ID) {
return null;
}
const redirectUri = getOAuthRedirectUri();
const handleGitHubLogin = () => {
try {
const params = new URLSearchParams({
client_id: GITHUB_CLIENT_ID,
redirect_uri: redirectUri,
state: 'github',
scope: 'user:email',
});
const githubAuthUrl = `https://github.com/login/oauth/authorize?${params.toString()}`;
// Validate URL is properly formed
new URL(githubAuthUrl);
window.location.href = githubAuthUrl;
} catch (error) {
message.error(t('users.oauth.invalidConfiguration'));
console.error('GitHub OAuth URL error:', error);
}
};
return (
<Button icon={<GithubOutlined />} onClick={handleGitHubLogin} className="w-full" size="large">
{t('users.oauth.continueWithGithub')}
</Button>
);
}