-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauth.min.js
1 lines (1 loc) · 1 KB
/
auth.min.js
1
"https:"!==location.protocol&&console.error("Replit authentication doesn't work with http:// normally. Please consider changing.");const repl_auth=function(t){(t={id:t.id,onAuth:t.onAuth||function(){window.location.reload()},onStartAuth:t.onStartAuth||function(){},width:t.width||350,height:t.height||500,host:t.host||location.host}).id&&document.getElementById(t.id)?document.getElementById(t.id).addEventListener("click",(()=>{repl_auth_click(t)})):console.error("Provide a valid button ID")},repl_auth_complete=function(t,o,e){"auth_complete"===t.data&&(e.close(),o())},repl_auth_click=function(t){t.onStartAuth(),window.addEventListener("message",(o=>{repl_auth_complete(o,t.onAuth,n)}));var o=screen.width/2-t.width/2,e=screen.height/2-t.height/2,n=window.open(location.protocol+"//repl.it/auth_with_repl_site?domain="+t.host,"_blank","modal =yes, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width="+t.width+", height="+t.height+", top="+e+", left="+o)};