Created
March 25, 2022 12:43
-
-
Save janniks/d62c4ceb77fab628d797504e466d274d to your computer and use it in GitHub Desktop.
authenticate — Stacks Authentication
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { AppConfig, UserSession, showConnect } from "@stacks/connect"; | |
const appConfig = new AppConfig(["store_write", "publish_data"]); | |
const userSession = new UserSession({ appConfig }); | |
function authenticate() { | |
showConnect({ | |
appDetails: { | |
name: "My App", | |
icon: window.location.origin + "/my-app-logo.svg", | |
}, | |
redirectTo: "/", | |
onFinish: () => { | |
let userData = userSession.loadUserData(); | |
// Save or otherwise utilize userData post-authentication | |
}, | |
userSession: userSession, | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment