mirror of
				https://github.com/KevinMidboe/zoff.git
				synced 2025-10-29 18:00:23 +00:00 
			
		
		
		
	Signing up for the API work again
- Can use the same email more than once, the only difference is that it wont create a new key, only a new link to the key
This commit is contained in:
		| @@ -54,7 +54,23 @@ router.route('/').post(function(req, res, next){ | ||||
|     root(req, res, next); | ||||
| }); | ||||
|  | ||||
| router.route('/api/apply/:id').get(function(req,res) { | ||||
| router.route('/api/apply').get(function(req, res, next) { | ||||
|     var data = { | ||||
|         year: year, | ||||
|         javascript_file: "token.min.js", | ||||
|         captcha: res.recaptcha, | ||||
|         analytics: analytics, | ||||
|         activated: false, | ||||
|         id: "", | ||||
|         correct: false, | ||||
|         stylesheet: "style.css", | ||||
|         embed: false, | ||||
|         og_image: "https://zoff.me/assets/images/small-square.jpg", | ||||
|     } | ||||
|     res.render('layouts/client/token', data); | ||||
| }); | ||||
|  | ||||
| router.route('/api/apply/:id').get(function(req, res) { | ||||
|     var id = req.params.id; | ||||
|     token_db.collection('api_links').find({id: id}, function(err, result) { | ||||
|         if(result.length == 1) { | ||||
| @@ -74,7 +90,7 @@ router.route('/api/apply/:id').get(function(req,res) { | ||||
|                     } | ||||
|                     res.render('layouts/client/token', data); | ||||
|                 }); | ||||
|             }) | ||||
|             }); | ||||
|         } else { | ||||
|             var data = { | ||||
|                 year: year, | ||||
| @@ -94,22 +110,6 @@ router.route('/api/apply/:id').get(function(req,res) { | ||||
| }); | ||||
|  | ||||
|  | ||||
| router.route('/api/apply').get(function(req, res, next) { | ||||
|     var data = { | ||||
|         year: year, | ||||
|         javascript_file: "token.min.js", | ||||
|         captcha: res.recaptcha, | ||||
|         analytics: analytics, | ||||
|         activated: false, | ||||
|         id: "", | ||||
|         correct: false, | ||||
|         stylesheet: "style.css", | ||||
|         embed: false, | ||||
|         og_image: "https://zoff.me/assets/images/small-square.jpg", | ||||
|     } | ||||
|     res.render('layouts/client/token', data); | ||||
| }); | ||||
|  | ||||
| function root(req, res, next) { | ||||
|     try{ | ||||
|         var url = req.headers['x-forwarded-host'] ? req.headers['x-forwarded-host'] : req.headers.host.split(":")[0]; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user