Skip to content

Commit 6809e0e

Browse files
committed
Simplify login-required template.
1 parent b5c5cac commit 6809e0e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

default-views/auth/login-required.hbs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1">
66
<title>Log in</title>
77
<link rel="stylesheet" href="/common/css/bootstrap.min.css">
8-
<script src="/common/js/solid-auth-client.bundle.js"></script>
98
</head>
109
<body>
1110
<div class="container">
@@ -20,17 +19,16 @@
2019
<button class="btn btn-primary" onclick="register()">Register</button>
2120
</div>
2221
</div>
22+
<script src="/common/js/solid-auth-client.bundle.js"></script>
2323
<script>
2424
async function login() {
25-
// Log in through the popup
26-
const popupUri = '/common/popup.html'
27-
const session = await SolidAuthClient.popupLogin({ popupUri })
25+
const session = await solid.auth.popupLogin()
2826
if (session) {
2927
// Make authenticated request to the server to establish a session cookie
30-
const { status } = await SolidAuthClient.fetch(location)
28+
const { status } = await solid.auth.fetch(location)
3129
if (status === 401) {
3230
alert(`Invalid login.\n\nDid you set ${session.idp} as your OIDC provider in your profile ${session.webId}?`);
33-
await SolidAuthClient.logout();
31+
await solid.auth.logout()
3432
}
3533
// Now that we have a cookie, reload to display the authenticated page
3634
location.reload()

0 commit comments

Comments
 (0)