Skip to content

Commit

Permalink
Updates Mage to use 0.13.0 (wasp-lang#1906)
Browse files Browse the repository at this point in the history
  • Loading branch information
infomiho authored Mar 19, 2024
1 parent 4313057 commit f6d4a8d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 114 deletions.
2 changes: 1 addition & 1 deletion mage/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ RUN cd .wasp/build/server && npm run bundle
# TODO: Use pm2?
# TODO: Use non-root user (node).
FROM base AS server-production
RUN curl -sSL https://get.wasp-lang.dev/installer.sh | sh -s -- -v 0.12.3
RUN curl -sSL https://get.wasp-lang.dev/installer.sh | sh -s -- -v 0.13.0
ENV PATH "$PATH:/root/.local/bin"
ENV NODE_ENV production
WORKDIR /app
Expand Down
2 changes: 1 addition & 1 deletion mage/main.wasp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
app waspAi {
wasp: {
version: "^0.12.2"
version: "^0.13.0"
},
title: "MAGE - GPT Web App Generator ✨",
head: [
Expand Down
102 changes: 0 additions & 102 deletions mage/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 6 additions & 10 deletions mage/src/server/auth.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,25 @@
import { defineUserSignupFields } from 'wasp/server/auth'

export const googleUserSignupFields = defineUserSignupFields({
email: async (data) => (data.profile as any)?.emails?.[0]?.value,
username: async (data) => (data.profile as any)?.emails?.[0]?.value,
email: async (data: any) => data.profile.email,
username: async (data: any) => data.profile?.email,
});

export const getGoogleAuthConfig = () => {
return {
clientID: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
scope: ["profile", "email"],
scopes: ["profile", "email"],
};
};

// NOTE: if we don't want to access users' emails, we can use scope ["user:read"]
// instead of ["user"] and access data.profile.username instead
export const gitHubUserSignupFields = defineUserSignupFields({
email: async (data) => (data.profile as any)?.emails?.[0]?.value,
username: async (data) => (data.profile as any)?.username,
email: async (data: any) => data.profile.email,
username: async (data: any) => data.profile.login,
})

export function getGitHubAuthConfig() {
return {
clientID: process.env.GITHUB_CLIENT_ID, // look up from env or elsewhere
clientSecret: process.env.GITHUB_CLIENT_SECRET, // look up from env or elsewhere
scope: ["user"],
scopes: ["user"],
};
}

0 comments on commit f6d4a8d

Please sign in to comment.