Skip to content

Commit

Permalink
Telegram auth
Browse files Browse the repository at this point in the history
  • Loading branch information
Arkadiy-Sedelnikov committed Jan 13, 2021
1 parent 66304fd commit 8f4b012
Show file tree
Hide file tree
Showing 8 changed files with 2,579 additions and 6 deletions.
5 changes: 4 additions & 1 deletion com_slogin/media/slogin.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ var SLogin = SLogin || {
},
initializeButtons: function(elements) {
var params = "resizable=yes,scrollbars=no,toolbar=no,menubar=no,location=no,directories=no,status=yes";
var id, onclick;
for (var i = 0; i < elements.length; i++) {
if (elements[i].getAttribute('id') == 'uLogin') {
id = elements[i].getAttribute('id');
onclick = elements[i].getAttribute('onclick');
if (id == 'uLogin' || onclick !== null) {
continue;
}
elements[i].onclick = function(e) {
Expand Down
1 change: 1 addition & 0 deletions plugins/slogin_auth/telegram/assets/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!DOCTYPE html><title></title>
17 changes: 17 additions & 0 deletions plugins/slogin_auth/telegram/assets/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
var SloginTelegram = {
url: '',
auth: function (data){
var json = JSON.stringify(data);
var form = document.createElement('form');
form.setAttribute("id", "telegramAuthForm");
form.setAttribute("method", "post");
form.setAttribute("action", SloginTelegram.url);
var input = document.createElement('input');
input.setAttribute("type", "hidden");
input.setAttribute("name", "data");
input.setAttribute("value", json);
form.appendChild(input);
document.getElementsByTagName("body")[0].appendChild(form);
document.getElementById('telegramAuthForm').submit();
}
};
Loading

0 comments on commit 8f4b012

Please sign in to comment.