Add auth starter

This commit is contained in:
2025-06-06 19:42:19 -04:00
parent 1c0c45841f
commit d6555ee216
15 changed files with 12890 additions and 18 deletions

View File

@@ -0,0 +1,43 @@
import {NuxtAuthHandler} from '#auth'
export default NuxtAuthHandler({
secret: "my-cool-secret",
providers: [
{
id: "default",
name: "default",
type: "oauth",
wellKnown: "",
clientId: "",
clientSecret: "",
authorization: {
params: {
scope: "openid email profile"
}
},
idToken: true,
// checks: [ "pkce", "state" ],
profile(profile) {
return {
id: profile.sub,
name: profile.name,
email: profile.email,
}
}
}
],
callbacks: {
async jwt({ token, account }) {
// Persist the access token to the token right after signin
if (account) {
token.accessToken = account.access_token;
}
return token;
},
async session({ session, token }) {
// Send properties to the client
session.accessToken = token.accessToken;
return session;
}
}
});

3
ui/server/tsconfig.json Normal file
View File

@@ -0,0 +1,3 @@
{
"extends": "../.nuxt/tsconfig.server.json"
}