@@ -392,68 +392,28 @@ <h3 style="color: #d4af37; margin-bottom: 15px; text-align: center;">🏛️ SSO
392392 }
393393 }
394394
395- // ========== GITHUB LOGIN CORRIGIDO ==========
395+ // ========== GITHUB LOGIN SIMPLIFICADO ==========
396396 function loginGithub ( ) {
397397 showLoading ( 'GitHub' ) ;
398398
399- // Para desenvolvimento local, usa login simulado
400- if ( window . location . hostname === 'localhost' || window . location . hostname === '127.0.0.1' ) {
401- console . log ( '🔄 Modo local - GitHub simulado' ) ;
402- setTimeout ( ( ) => {
403- const userData = {
404- provider : "github" ,
405- userId : "github_" + Date . now ( ) ,
406- 407- name : "GitHub Developer" ,
408- avatar_url : "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png"
409- } ;
410- criarContaERedirecionar ( userData ) ;
411- } , 1500 ) ;
412- return ;
413- }
414-
415- // Para produção, verifica se estamos na página de callback
416- if ( window . location . search . includes ( 'code=' ) ) {
417- processarCallbackGitHub ( ) ;
418- return ;
419- }
420-
421- // Se não é callback, inicia o fluxo OAuth
422- iniciarOAuthGitHub ( ) ;
423- }
424-
425- // ========== INICIAR OAUTH GITHUB ==========
426- function iniciarOAuthGitHub ( ) {
427- const clientId = "Ov23liJ8ewJBXHhryv7y" ;
428- const redirectUri = encodeURIComponent ( window . location . origin + "/auth/github/callback.html" ) ;
429- const scope = "read:user user:email" ;
430-
431- const authUrl =
432- `https://github.com/login/oauth/authorize?client_id=${ clientId } ` +
433- `&redirect_uri=${ redirectUri } ` +
434- `&scope=${ scope } ` ;
435-
436- console . log ( '🌐 Redirecionando para GitHub OAuth...' , authUrl ) ;
437- window . location . href = authUrl ;
438- }
439-
440- // ========== PROCESSAR CALLBACK GITHUB ==========
441- function processarCallbackGitHub ( ) {
442- console . log ( '🔄 Processando callback do GitHub...' ) ;
443-
444- // Simulação - em produção você faria uma chamada para seu backend
445- // para trocar o code por access_token
399+ // SEMPRE usa login simulado por enquanto
400+ // Para evitar problemas de configuração OAuth
401+ console . log ( '🔄 GitHub - Modo simulado (sem OAuth)' ) ;
446402 setTimeout ( ( ) => {
447403 const userData = {
448404 provider : "github" ,
449- userId : "github_" + Math . floor ( Math . random ( ) * 1000000 ) ,
450- email : "usuario @github.com" ,
451- name : "Usuário GitHub" ,
405+ userId : "github_" + Date . now ( ) ,
406+ email : "dev @github.com" ,
407+ name : "GitHub Developer " ,
452408 avatar_url : "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png"
453409 } ;
454-
455410 criarContaERedirecionar ( userData ) ;
456- } , 1000 ) ;
411+ } , 1500 ) ;
412+
413+ // Se quiser usar OAuth real mais tarde, você precisará:
414+ // 1. Configurar o aplicativo GitHub OAuth corretamente
415+ // 2. Adicionar a URL de callback autorizada no GitHub
416+ // 3. Ter um backend para trocar o code por access_token
457417 }
458418
459419 // ========== SSO ==========
@@ -582,9 +542,6 @@ <h3 style="color: #d4af37; margin-bottom: 15px; text-align: center;">🏛️ SSO
582542 document . addEventListener ( 'DOMContentLoaded' , function ( ) {
583543 console . log ( '🚀 Login Terra Dourada carregado' ) ;
584544
585- // REMOVIDO: O login automático que estava causando o problema
586- // Agora o usuário precisa clicar manualmente em uma opção de login
587-
588545 // Fecha modal se clicar fora
589546 document . getElementById ( 'ssoModal' ) . addEventListener ( 'click' , function ( e ) {
590547 if ( e . target === this ) {
0 commit comments