天天看點

docker desktop url protocl 技術以及使用

docker desktop 在登入的使用使用了自定義的url 協定,同時基于web 進行系統登入,認證完成之後會生成code,之後通過

url 協定進入

使用

  • docker

    協定定義

<array>      
<dict>      
<key>CFBundleTypeRole</key>      
<string>Editor</string>      
<key>CFBundleURLName</key>      
<string>docker-desktop</string>      
<key>CFBundleURLSchemes</key>      
<array>      
<string>docker-desktop</string>      
</array>      
</dict>      
</array>      

js 使用

​​​https://d36jcksde1wxzq.cloudfront.net/9241.d6356172711deaa97954.js​​​

處理

function v() {      
const {search: a} = (0,      
s.TH)()      
e = p()      
c = `docker-desktop://auth0/complete-login${a}`;      
return (0,      
l.useEffect)((()=>{      
window.Cypress || (window.location.href = c)      
}      
c]),      
l.createElement(l.Fragment, null, l.createElement(h.ql, {      
title: "Redirecting..."      
l.createElement(t.Z, {      
maxWidth: "sm",      
className: e.root,      
"data-testid": "desktop-auth-page"      
l.createElement(m.Z, {      
className: e.logo      
l.createElement(n.Z, {      
className: e.paper      
l.createElement(r.Z, {      
variant: "h2",      
component: "h1",      
className: e.title      
"You're almost done!"), l.createElement(r.Z, {      
className: e.explanation      
"We're redirecting you to the desktop app. If you don't see a dialog, please click the button below."), l.createElement(o.Z, {      
href: c,      
variant: "contained",      
color: "primary"      
"Proceed to Docker Desktop"))))      
}      
}      
docker-desktop://auth0/complete-login?code=<code>      

說明

參考資料