Added sample config
This commit is contained in:
		@@ -185,7 +185,7 @@ class WNSAuth extends EventEmitter
 | 
			
		||||
 | 
			
		||||
	__authWNS()
 | 
			
		||||
	{
 | 
			
		||||
		var serviceAuth = cl.load( "notifyterm.config.auth" );
 | 
			
		||||
		var serviceAuth = cl.load( "notifyterm.config.auth", true );
 | 
			
		||||
 | 
			
		||||
		var Request = new HttpRequest( serviceAuth.Uri );
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -9,6 +9,7 @@ var Base = cl.load( "notifysrv.postframe" );
 | 
			
		||||
var WNSAuth = cl.load( "notifyterm.WNSAuth" );
 | 
			
		||||
var Model = cl.load( "notifyterm.schema" );
 | 
			
		||||
var NotisQ = cl.load( "notifyterm.Notis" );
 | 
			
		||||
var SrvAuth = cl.load( "notifyterm.config.auth" );
 | 
			
		||||
 | 
			
		||||
class App extends Base
 | 
			
		||||
{
 | 
			
		||||
@@ -32,6 +33,20 @@ class App extends Base
 | 
			
		||||
		var _self = this;
 | 
			
		||||
		var query = e.Data;
 | 
			
		||||
 | 
			
		||||
		// Protected Actions
 | 
			
		||||
		switch( query.action )
 | 
			
		||||
		{
 | 
			
		||||
			case "register":
 | 
			
		||||
			case "remove":
 | 
			
		||||
				if(!( query.pass && query.pass == SrvAuth.Client ))
 | 
			
		||||
				{
 | 
			
		||||
					this.result = "Unauthorized Access";
 | 
			
		||||
					this.plantResult();
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				break;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		switch( query.action )
 | 
			
		||||
		{
 | 
			
		||||
			case "register":
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										11
									
								
								notify-term/config/auth.js.example
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								notify-term/config/auth.js.example
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,11 @@
 | 
			
		||||
module.exports = {
 | 
			
		||||
    // Defined in Docs
 | 
			
		||||
	Uri: "https://login.live.com/accesstoken.srf"
 | 
			
		||||
 | 
			
		||||
    // Given by Dev center
 | 
			
		||||
	, Id: "ms-app://s-1-11-1-1111111111-1111111111-1111111111-1111111111-11111111-1111111111-1111111111"
 | 
			
		||||
	, Secret: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
 | 
			
		||||
 | 
			
		||||
    // basic protection pass
 | 
			
		||||
	, Client: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										7
									
								
								notify-term/config/db.js.example
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								notify-term/config/db.js.example
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,7 @@
 | 
			
		||||
module.exports = {
 | 
			
		||||
	host: "mongodb://123.456.789.0/database_name"
 | 
			
		||||
	, auth:{
 | 
			
		||||
		user: "UserName"
 | 
			
		||||
		, pass: "Password"
 | 
			
		||||
	}
 | 
			
		||||
};
 | 
			
		||||
		Reference in New Issue
	
	Block a user