@cloudron/tegel 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +7 -2
- package/logo.png +0 -0
- package/logo.svg +82 -0
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -31,7 +31,7 @@ export async function createExpressApp({ sessionSecret = 'changeme', oidcConfig
|
|
|
31
31
|
|
|
32
32
|
app.use(lastMile());
|
|
33
33
|
|
|
34
|
-
return { app, router };
|
|
34
|
+
return { app, router, express };
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
export const servePath = express.static;
|
|
@@ -46,6 +46,7 @@ export async function oidcRedirectToLoginProvider(req, res, next) {
|
|
|
46
46
|
const refererUrl = new URL(referer);
|
|
47
47
|
// Store the origin (e.g., http://localhost:5173) to redirect back after auth
|
|
48
48
|
req.session.frontendOrigin = refererUrl.origin;
|
|
49
|
+
// eslint-disable-next-line no-unused-vars
|
|
49
50
|
} catch (e) {
|
|
50
51
|
// Invalid referer, ignore
|
|
51
52
|
}
|
|
@@ -60,9 +61,10 @@ export async function oidcRedirectToLoginProvider(req, res, next) {
|
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
|
|
63
|
-
export function oidcCallback(successRedirectTo, errorRedirectTo) {
|
|
64
|
+
export function oidcCallback(successRedirectTo, errorRedirectTo, successHook = async () => {}) {
|
|
64
65
|
if (!successRedirectTo || typeof successRedirectTo !== 'string') throw new Error('oidcCallback needs a successRedirectTo path as non-empty string');
|
|
65
66
|
if (!errorRedirectTo || typeof errorRedirectTo !== 'string') throw new Error('oidcCallback needs a errorRedirectTo path as non-empty string');
|
|
67
|
+
if (!successHook || typeof successHook !== 'function') throw new Error('oidcCallback needs a successHook path as a function');
|
|
66
68
|
|
|
67
69
|
return async (req, res) => {
|
|
68
70
|
// Redirect to the frontend origin that initiated the login (supports Vite dev server)
|
|
@@ -74,6 +76,8 @@ export function oidcCallback(successRedirectTo, errorRedirectTo) {
|
|
|
74
76
|
|
|
75
77
|
req.session.user = user;
|
|
76
78
|
|
|
79
|
+
await successHook(user);
|
|
80
|
+
|
|
77
81
|
res.redirect((frontendOrigin || '') + successRedirectTo);
|
|
78
82
|
} catch (error) {
|
|
79
83
|
console.error('Callback error:', error);
|
|
@@ -96,6 +100,7 @@ export function logout(redirectTo) {
|
|
|
96
100
|
try {
|
|
97
101
|
const refererUrl = new URL(referer);
|
|
98
102
|
redirectUri = refererUrl.origin;
|
|
103
|
+
// eslint-disable-next-line no-unused-vars
|
|
99
104
|
} catch (e) {
|
|
100
105
|
// Invalid referer, use default
|
|
101
106
|
}
|
package/logo.png
ADDED
|
Binary file
|
package/logo.svg
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<svg
|
|
3
|
+
width="512"
|
|
4
|
+
height="512"
|
|
5
|
+
viewBox="0 0 384 384.00001"
|
|
6
|
+
version="1.2"
|
|
7
|
+
id="svg177"
|
|
8
|
+
sodipodi:docname="Flughafen_Berlin-Tegel_(2003).svg"
|
|
9
|
+
inkscape:version="1.4.3 (0d15f75042, 2025-12-25)"
|
|
10
|
+
inkscape:export-filename="logo.png"
|
|
11
|
+
inkscape:export-xdpi="96"
|
|
12
|
+
inkscape:export-ydpi="96"
|
|
13
|
+
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
14
|
+
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
15
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
16
|
+
xmlns:svg="http://www.w3.org/2000/svg"
|
|
17
|
+
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
18
|
+
xmlns:cc="http://creativecommons.org/ns#"
|
|
19
|
+
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
|
20
|
+
<title
|
|
21
|
+
id="title80827">Berlin Tegel (2003)</title>
|
|
22
|
+
<sodipodi:namedview
|
|
23
|
+
id="namedview179"
|
|
24
|
+
pagecolor="#ffffff"
|
|
25
|
+
bordercolor="#111111"
|
|
26
|
+
borderopacity="1"
|
|
27
|
+
inkscape:pageshadow="0"
|
|
28
|
+
inkscape:pageopacity="0"
|
|
29
|
+
inkscape:pagecheckerboard="1"
|
|
30
|
+
inkscape:document-units="pt"
|
|
31
|
+
showgrid="false"
|
|
32
|
+
inkscape:zoom="1.3634758"
|
|
33
|
+
inkscape:cx="254.86334"
|
|
34
|
+
inkscape:cy="262.19754"
|
|
35
|
+
inkscape:window-width="1920"
|
|
36
|
+
inkscape:window-height="1014"
|
|
37
|
+
inkscape:window-x="0"
|
|
38
|
+
inkscape:window-y="0"
|
|
39
|
+
inkscape:window-maximized="1"
|
|
40
|
+
inkscape:current-layer="svg177"
|
|
41
|
+
inkscape:showpageshadow="2"
|
|
42
|
+
inkscape:deskcolor="#d1d1d1"
|
|
43
|
+
showguides="true" />
|
|
44
|
+
<defs
|
|
45
|
+
id="defs62" />
|
|
46
|
+
<g
|
|
47
|
+
id="g1"
|
|
48
|
+
transform="translate(11.511545,8.6889135)">
|
|
49
|
+
<path
|
|
50
|
+
style="fill:#19458f;fill-opacity:1;fill-rule:nonzero;stroke:#19458f;stroke-width:0.571433;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:3.864;stroke-opacity:1"
|
|
51
|
+
d="m 207.17908,0.28571635 h 67.31829 L 191.08988,144.84555 l 42.32259,74.76617 h -66.69954 l -43.2508,-74.63363 z m 0,0"
|
|
52
|
+
id="path68" />
|
|
53
|
+
<path
|
|
54
|
+
style="fill:#19458f;fill-opacity:1;fill-rule:nonzero;stroke:#19458f;stroke-width:0.571433;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:3.864;stroke-opacity:1"
|
|
55
|
+
d="M 67.8129,364.4809 H 0.49464934 L 83.880064,219.92115 41.557479,145.15489 h 66.699461 l 43.27291,74.63363 z m 0,0"
|
|
56
|
+
id="path70" />
|
|
57
|
+
<path
|
|
58
|
+
style="fill:#19458f;fill-opacity:1;fill-rule:nonzero;stroke:#19458f;stroke-width:0.571433;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:3.864;stroke-opacity:1"
|
|
59
|
+
d="m 328.06913,231.81123 32.42152,58.19078 H 195.42156 l -43.75908,76.04802 -34.63162,-59.98091 42.87513,-74.25789 z m 0,0"
|
|
60
|
+
id="path72" />
|
|
61
|
+
</g>
|
|
62
|
+
<text
|
|
63
|
+
xml:space="preserve"
|
|
64
|
+
style="font-weight:bold;font-size:45px;line-height:1.25;font-family:'Helvetica Neue LT Std';-inkscape-font-specification:'Helvetica Neue LT Std Bold';stroke-width:0.75"
|
|
65
|
+
x="109.5576"
|
|
66
|
+
y="67.842606"
|
|
67
|
+
id="text32536"><tspan
|
|
68
|
+
sodipodi:role="line"
|
|
69
|
+
id="tspan32534"
|
|
70
|
+
style="font-size:45px;stroke-width:0.75"
|
|
71
|
+
x="109.5576"
|
|
72
|
+
y="67.842606" /></text>
|
|
73
|
+
<metadata
|
|
74
|
+
id="metadata80825">
|
|
75
|
+
<rdf:RDF>
|
|
76
|
+
<cc:Work
|
|
77
|
+
rdf:about="">
|
|
78
|
+
<dc:title>Berlin Tegel (2003)</dc:title>
|
|
79
|
+
</cc:Work>
|
|
80
|
+
</rdf:RDF>
|
|
81
|
+
</metadata>
|
|
82
|
+
</svg>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudron/tegel",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "GPL-2.0",
|
|
6
6
|
"author": "Cloudron Developers",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"openid-client": "^6.8.1"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@eslint/js": "^9.
|
|
21
|
+
"@eslint/js": "^9.39.2",
|
|
22
22
|
"eslint": "^9.39.2",
|
|
23
|
-
"globals": "^
|
|
23
|
+
"globals": "^17.1.0"
|
|
24
24
|
}
|
|
25
25
|
}
|