Skip to content

Commit 40ce1e1

Browse files
committed
Migrate to 0.13
Signed-off-by: Mihovil Ilakovac <[email protected]>
1 parent 62a48dc commit 40ce1e1

File tree

3 files changed

+9
-99
lines changed

3 files changed

+9
-99
lines changed

app/main.wasp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
app OpenSaaS {
22
wasp: {
3-
version: "^0.12.0"
3+
version: "^0.13.0"
44
},
55
title: "My Open SaaS App",
66
head: [

app/package-lock.json

Lines changed: 0 additions & 84 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/server/auth/setUsername.ts

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,26 @@ export const getEmailUserFields = defineUserSignupFields({
1515
export const getGitHubUserFields = defineUserSignupFields({
1616
// NOTE: if we don't want to access users' emails, we can use scope ["user:read"]
1717
// instead of ["user"] and access args.profile.username instead
18-
email: (data: any) => data.profile.emails[0].value,
19-
username: (data: any) => data.profile.username,
20-
isAdmin: (data: any) => adminEmails.includes(data.profile.emails[0].value),
18+
email: (data: any) => data.profile.emails[0].email,
19+
username: (data: any) => data.profile.login,
20+
isAdmin: (data: any) => adminEmails.includes(data.profile.emails[0].email),
2121
});
2222

2323
export function getGitHubAuthConfig() {
2424
return {
25-
clientID: process.env.GITHUB_CLIENT_ID, // look up from env or elsewhere
26-
clientSecret: process.env.GITHUB_CLIENT_SECRET, // look up from env or elsewhere
27-
scope: ['user'],
25+
scopes: ['user'],
2826
};
2927
}
3028

3129
export const getGoogleUserFields = defineUserSignupFields({
32-
email: (data: any) => data.profile.emails[0].value,
33-
username: (data: any) => data.profile.displayName,
34-
isAdmin: (data: any) => adminEmails.includes(data.profile.emails[0].value),
30+
email: (data: any) => data.profile.email,
31+
username: (data: any) => data.profile.name,
32+
isAdmin: (data: any) => adminEmails.includes(data.profile.email),
3533
});
3634

3735
export function getGoogleAuthConfig() {
38-
const clientID = process.env.GOOGLE_CLIENT_ID;
39-
const clientSecret = process.env.GOOGLE_CLIENT_SECRET;
4036
return {
41-
clientID, // look up from env or elsewhere,
42-
clientSecret, // look up from env or elsewhere,
43-
scope: ['profile', 'email'], // must include at least 'profile' for Google
37+
scopes: ['profile', 'email'], // must include at least 'profile' for Google
4438
};
4539
}
4640

0 commit comments

Comments
 (0)