parent
2b95fc17a6
commit
dc2cec78dc
@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* Invite Model
|
||||||
|
* -------------------------------------------------------------
|
||||||
|
* Put some description here!
|
||||||
|
*/
|
||||||
|
const Invite = {
|
||||||
|
project_id: String,
|
||||||
|
by_user_id: String,
|
||||||
|
created_on: Date,
|
||||||
|
used: { type: Boolean, default: false }
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = exports = Invite
|
@ -0,0 +1,26 @@
|
|||||||
|
/*
|
||||||
|
* Invite Middleware
|
||||||
|
* -------------------------------------------------------------
|
||||||
|
* Put some description here!
|
||||||
|
*/
|
||||||
|
class Invite {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Run the middleware test.
|
||||||
|
* This method is required by all Flitter middleware.
|
||||||
|
* It should either call the next function in the stack,
|
||||||
|
* or it should handle the response accordingly.
|
||||||
|
*/
|
||||||
|
test(req, res, next, args = {}){
|
||||||
|
if ( req.session.invite && !req.originalUrl.includes('/dash/v1/invitation/accept') ){
|
||||||
|
return res.redirect('/dash/v1/invitation/accept')
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Call the next function in the stack.
|
||||||
|
*/
|
||||||
|
next()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = Invite
|
@ -0,0 +1,19 @@
|
|||||||
|
html
|
||||||
|
head
|
||||||
|
title Project Invitation | DevBug
|
||||||
|
link(rel='stylesheet' href='/assets/dash_v1.css')
|
||||||
|
script(src='/assets/dash_v1.js')
|
||||||
|
body
|
||||||
|
.page-header
|
||||||
|
.devbug-header DevBug | v#{devbug.version} #{(project ? " | Project: "+project.name+" | API: "+project.uuid : "")}
|
||||||
|
h1 Accept Invitation?
|
||||||
|
ul.navul
|
||||||
|
li.navli
|
||||||
|
a.nava(href='/dash/v1') Dashboard Login
|
||||||
|
.spacer
|
||||||
|
p You've been invited to view the debugging project "#{project.name}" by #{user.username}.
|
||||||
|
p To accept this invitation, you must have a DevBug account. You will be redirected to the registration portal.
|
||||||
|
a.btn(href='/api/v1/invitation/'+invite.id+'/accept') Accept
|
||||||
|
br
|
||||||
|
h3 What's DevBug?
|
||||||
|
p DevBug is a debugging output server used to help developers work more efficiently. Using inline-code clients, developers can output variables and data from their programs. This data is stored in a DevBug project, where it can easily be shared with others.
|
@ -0,0 +1,7 @@
|
|||||||
|
extends ./template
|
||||||
|
block content
|
||||||
|
p You can send this link to someone without a DevBug account to invite them to register.
|
||||||
|
p Once they register, #{project.name} will be shared with them. This link can only be used once.
|
||||||
|
h3 Invitation Link
|
||||||
|
pre
|
||||||
|
code #{_flitter.config('server.url')+'/api/v1/invitation/'+share.id}
|
Loading…
Reference in new issue