You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// see #1 https://octokit.github.io/rest.js/v18#orgs-check-membership
72
-
// see #2 https://github.com/octokit/octokit.js
73
-
// see #3 https://github.com/thundergolfer/automated-github-organization-invites/blob/bb1bb3d42a330716f4dd5c49256245e4bde27489/web_app.rb
74
-
ctx.session.user={
75
-
...user,
76
-
pay: true,
77
-
};
78
-
79
-
ctx.cookies.set(
80
-
"token",
81
-
encrypt(
82
-
Buffer.from(
83
-
JSON.stringify({
84
-
...user,
85
-
pay: true,
86
-
}),
87
-
"utf8"
88
-
)
89
-
),
90
-
{
91
-
httpOnly: false,
92
-
expires: newDate(24*60*60*1000+Date.now()),
93
-
}
94
-
);
95
-
}else{
96
-
ctx.session.user={
97
-
...user,
98
-
pay: false,
99
-
};
100
-
101
-
ctx.cookies.set(
102
-
"token",
103
-
encrypt(
104
-
Buffer.from(
105
-
JSON.stringify({
106
-
...user,
107
-
pay: false,
108
-
}),
109
-
"utf8"
110
-
)
111
-
),
112
-
{
113
-
httpOnly: false,
114
-
expires: newDate(24*60*60*1000+Date.now()),
115
-
}
116
-
);
117
-
}
61
+
constu={
62
+
...user,
63
+
pay: !!db.find((q)=>q.login===user.login),
64
+
};
65
+
// TODO: 如果不在组织中,自动邀请进 Github 组织
66
+
// see #1 https://octokit.github.io/rest.js/v18#orgs-check-membership
67
+
// see #2 https://github.com/octokit/octokit.js
68
+
// see #3 https://github.com/thundergolfer/automated-github-organization-invites/blob/bb1bb3d42a330716f4dd5c49256245e4bde27489/web_app.rb
0 commit comments