Fix Mozilla Persona login

This commit is contained in:
Frédéric Guillot 2013-12-22 21:43:29 -05:00
parent 387600ca10
commit 7648191239
2 changed files with 3 additions and 4 deletions

View File

@ -12,8 +12,7 @@ Miniflux.App = (function() {
onlogin: function(assertion) { onlogin: function(assertion) {
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
xhr.open("POST", "?action=" + action, true); xhr.open("POST", "?action=" + action + "&token=" + assertion, true);
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhr.setRequestHeader("Connection", "close"); xhr.setRequestHeader("Connection", "close");
xhr.onload = function () { xhr.onload = function () {

View File

@ -106,7 +106,7 @@ Router\post_action('mozilla-auth', function() {
require 'vendor/PicoTools/AuthProvider.php'; require 'vendor/PicoTools/AuthProvider.php';
list($valid, $token) = AuthProvider\mozilla_validate(Request\value('token')); list($valid, $token) = AuthProvider\mozilla_validate(Request\param('token'));
if ($valid && $token === Model\Config\get('auth_mozilla_token')) { if ($valid && $token === Model\Config\get('auth_mozilla_token')) {
@ -127,7 +127,7 @@ Router\post_action('mozilla-link', function() {
require 'vendor/PicoTools/AuthProvider.php'; require 'vendor/PicoTools/AuthProvider.php';
list($valid, $token) = AuthProvider\mozilla_validate(Request\value('token')); list($valid, $token) = AuthProvider\mozilla_validate(Request\param('token'));
if ($valid) { if ($valid) {
Model\Config\save_auth_token('mozilla', $token); Model\Config\save_auth_token('mozilla', $token);