Compare commits
3 Commits
45ebb7d9cf
...
master
Author | SHA1 | Date | |
---|---|---|---|
abceb07c1a | |||
2c71563efc | |||
f39ce0977f |
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "archery",
|
"name": "archery",
|
||||||
"version": "0.2.0",
|
"version": "0.2.2",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "archery",
|
"name": "archery",
|
||||||
"version": "0.2.0",
|
"version": "0.2.2",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"body-parser": "^2.2.0",
|
"body-parser": "^2.2.0",
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "archery",
|
"name": "archery",
|
||||||
"version": "0.2.0",
|
"version": "0.2.2",
|
||||||
"description": "Build Arch packages through a web interface",
|
"description": "Build Arch packages through a web interface",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"docker",
|
"docker",
|
||||||
|
@@ -216,6 +216,15 @@ class DB extends Store {
|
|||||||
return user.id;
|
return user.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async upsertUser(user: User): Promise<string> {
|
||||||
|
await this.user.upsert({
|
||||||
|
id: user.id,
|
||||||
|
username: user.username,
|
||||||
|
displayName: user.displayName || null
|
||||||
|
});
|
||||||
|
return user.id;
|
||||||
|
}
|
||||||
|
|
||||||
public async createBuild(repo: string, commit: string, patch: string, distro: string, dependencies: string, author: string, uuid: string): Promise<number> {
|
public async createBuild(repo: string, commit: string, patch: string, distro: string, dependencies: string, author: string, uuid: string): Promise<number> {
|
||||||
const buildRec = await this.build.create({
|
const buildRec = await this.build.create({
|
||||||
repo,
|
repo,
|
||||||
|
@@ -324,17 +324,15 @@ class Web {
|
|||||||
userInfoURL: openidconf.userinfo_endpoint,
|
userInfoURL: openidconf.userinfo_endpoint,
|
||||||
clientID: options.oidc.clientId,
|
clientID: options.oidc.clientId,
|
||||||
clientSecret: options.oidc.clientSecret,
|
clientSecret: options.oidc.clientSecret,
|
||||||
callbackURL: `${baseUrl}cb`
|
callbackURL: `${baseUrl}cb`,
|
||||||
|
scope: 'profile'
|
||||||
}, async (_: string, profile: passport.Profile, cb: OpenIDConnectStrategy.VerifyCallback) => {
|
}, async (_: string, profile: passport.Profile, cb: OpenIDConnectStrategy.VerifyCallback) => {
|
||||||
const userObj: User = {
|
const userObj: User = {
|
||||||
id: profile.id,
|
id: profile.id,
|
||||||
username: profile.username,
|
username: profile.username,
|
||||||
displayName: profile.displayName
|
displayName: profile.displayName
|
||||||
};
|
};
|
||||||
const user = await this.db.getUser(profile.id);
|
await this.db.upsertUser(userObj);
|
||||||
if (!user) {
|
|
||||||
await this.db.createUser(userObj);
|
|
||||||
}
|
|
||||||
return cb(null, userObj);
|
return cb(null, userObj);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -31,7 +31,7 @@
|
|||||||
<a href="/build?id=<%= build.sqid %>" class="button">Clone</a>
|
<a href="/build?id=<%= build.sqid %>" class="button">Clone</a>
|
||||||
</div>
|
</div>
|
||||||
<% } %>
|
<% } %>
|
||||||
<% if (!ended) { %>
|
<% if (!ended && !public) { %>
|
||||||
<div id="cancelRow">
|
<div id="cancelRow">
|
||||||
<a href="cancel" class="button">Cancel build</a>
|
<a href="cancel" class="button">Cancel build</a>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user