Skip to content

Commit

Permalink
undoing login for now
Browse files Browse the repository at this point in the history
  • Loading branch information
YetAnotherJonWilson committed Jun 22, 2024
1 parent e6760b1 commit c52d0f4
Show file tree
Hide file tree
Showing 2 changed files with 260 additions and 3,630 deletions.
37 changes: 19 additions & 18 deletions app/add-resource/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,26 @@ export default function Page() {
const session = getDefaultSession();
// TODO: persist session upon refresh (by default, refreshing the page logs out the user)
// see https://docs.inrupt.com/developer-tools/javascript/client-libraries/tutorial/restore-session-browser-refresh/
if (typeof window !== 'undefined') {
handleIncomingRedirect({ restorePreviousSession: true }).then((info) => {
console.log('info.isloggedin', info?.isLoggedIn);
setWebID(info?.webId || '');
if (info?.isLoggedIn) {
setLoggedIn(true);
}
});
}
// if (typeof window !== 'undefined') {
// handleIncomingRedirect({ restorePreviousSession: true }).then((info) => {
// console.log('info.isloggedin', info?.isLoggedIn);
// setWebID(info?.webId || '');
// if (info?.isLoggedIn) {
// setLoggedIn(true);
// }
// });
// }

function startLogin() {
if (!getDefaultSession().info.isLoggedIn) {
login({
oidcIssuer: 'https://onboarding.solidcommunity.net',
redirectUrl: 'http://localhost:3000/add-resource',
clientName: 'Solid Onboarding',
});
}
}
// function startLogin() {
// console.log('LOGGING IN');
// if (!getDefaultSession().info.isLoggedIn) {
// login({
// oidcIssuer: 'https://onboarding.solidcommunity.net',
// redirectUrl: 'http://localhost:3000/add-resource',
// clientName: 'Solid Onboarding',
// });
// }
// }

return (
<div className="mt-10 ml-10">
Expand Down
Loading

0 comments on commit c52d0f4

Please sign in to comment.