init repo

This commit is contained in:
JIANG
2025-09-09 10:01:21 +08:00
commit d70d1709d3
34 changed files with 13652 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
import KeycloakProvider from "next-auth/providers/keycloak";
const authOptions = {
// Configure one or more authentication providers
providers: [
// !!! Should be stored in .env file.
KeycloakProvider({
clientId: `refine-demo`,
clientSecret: `refine`,
issuer: `https://lemur-0.cloud-iam.com/auth/realms/refine`,
profile(profile) {
return {
id: profile.sub,
name: profile.name ?? profile.preferred_username,
email: profile.email,
image: `https://faces-img.xcdn.link/thumb-lorem-face-6312_thumb.jpg`,
};
},
}),
],
secret: `UItTuD1HcGXIj8ZfHUswhYdNd40Lc325R8VlxQPUoR0=`,
};
export default authOptions;

View File

@@ -0,0 +1,5 @@
import NextAuth from "next-auth/next";
import authOptions from "./options";
const auth = NextAuth(authOptions);
export { auth as GET, auth as POST };