惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

W
WeLiveSecurity
Jina AI
Jina AI
博客园 - 司徒正美
雷峰网
雷峰网
宝玉的分享
宝玉的分享
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园_首页
WordPress大学
WordPress大学
Google DeepMind News
Google DeepMind News
GbyAI
GbyAI
MyScale Blog
MyScale Blog
Apple Machine Learning Research
Apple Machine Learning Research
美团技术团队
I
InfoQ
博客园 - Franky
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志
Cyberwarzone
Cyberwarzone
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Schneier on Security
P
Privacy & Cybersecurity Law Blog
T
Threatpost
Cloudbric
Cloudbric
D
Docker
M
MIT News - Artificial intelligence
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Vercel News
Vercel News
Martin Fowler
Martin Fowler
J
Java Code Geeks
AWS News Blog
AWS News Blog
The Cloudflare Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
L
Lohrmann on Cybersecurity
Hacker News: Ask HN
Hacker News: Ask HN
Last Week in AI
Last Week in AI
S
Security @ Cisco Blogs
Help Net Security
Help Net Security
C
Cisco Blogs
V
V2EX
博客园 - 【当耐特】
I
Intezer
爱范儿
爱范儿
F
Fortinet All Blogs
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
P
Privacy International News Feed
IT之家
IT之家
L
LINUX DO - 最新话题
B
Blog RSS Feed
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO

Feed of "schmarty/gem-diamond"

issue when using indieauth[dot]com? gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond proxy for profile images gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond
gem-diamond
schmarty · 2024-08-26 · via Feed of "schmarty/gem-diamond"

共有 2 个文件被更改,包括 76 次插入0 次删除

@ -0,0 +1,72 @@
<?php
namespace App;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
class IndieAuthController extends \Schmarty\Micropubkit\IndieAuthController {
/**
* Extend MicropubKit login_start.
* If the regular IndieAuth-endpoint lookup fails, fall back to indielogin.com
*/
public function login_start(ServerRequestInterface $request): ResponseInterface {
$this->flash = $request->getAttribute('flash');
$this->loginPath = $this->loginFormPath($request);
$params = $request->getParsedBody();
if(!isset($params['me']) || empty($params['me'])) {
return $this->error_redirect('missing_url', 'Website URL is required');
}
list($authorizationURL, $error) = \IndieAuth\Client::begin($params['me'], $this->scopes);
if($error) {
// use indielogin instead
// NOTE: this duplicates a _bunch_ of \IndieAuth\Client::begin. Smells like
// a refactor maybe?
$state = \IndieAuth\Client::generateStateParameter();
$codeVerifier = \IndieAuth\Client::generatePKCECodeVerifier();
// set up session info so \IndieAuth\Client can find it later
$_SESSION['indieauth_entered_url'] = $params['me'];
$_SESSION['indieauth_state'] = $state;
$_SESSION['indieauth_code_verifier'] = $codeVerifier;
$_SESSION['indieauth_authorization_endpoint'] = 'https://indielogin.com/auth';
// HACK 2024-08-25: indielogin.com maybe only has our old client_id
$clientId = \IndieAuth\Client::$clientID;
$u = parse_url($clientId);
\IndieAuth\Client::$clientID = $u['scheme'] . '://' . $u['host'] . '/';
$authorizationURL = \IndieAuth\Client::buildAuthorizationURL(
"https://indielogin.com/auth",
[
'me' => $params['me'],
'redirect_uri' => \IndieAuth\Client::$redirectURL,
'client_id' => \IndieAuth\Client::$clientID,
'code_verifier' => $codeVerifier,
'state' => $state,
]
);
}
return $this->response->withHeader('Location', $authorizationURL)->withStatus(302);
}
// FIXME: remove this once indielogin.com allows https://xn--sr8hvo.ws/auth/id client ID
public function login_callback(ServerRequestInterface $request): ResponseInterface {
if ($_SESSION['indieauth_authorization_endpoint'] === 'https://indielogin.com/auth')
{
// HACK 2024-08-25: indielogin.com maybe only has our old client_id
$clientId = \IndieAuth\Client::$clientID;
$u = parse_url($clientId);
\IndieAuth\Client::$clientID = $u['scheme'] . '://' . $u['host'] . '/';
}
return parent::login_callback($request);
}
}
@ -13,6 +13,10 @@ $app = new Micropubkit\IndieAuthEngine(dirname(__FILE__).'/../views', [
'logo_uri' => \Config::$logo_uri,
]);
// override indieauth controller
$app->container->extend(Micropubkit\IndieAuthController::class)
->setConcrete(App\IndieAuthController::class);
// set up db
$app->container->addShared(App\DB::class)