feat(module,auth): auth based on jwt
This commit is contained in:
9
pkg/module/auth/testdata/auth.js
vendored
Normal file
9
pkg/module/auth/testdata/auth.js
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
|
||||
function testAuth(ctx) {
|
||||
var subject = auth.getSubject(ctx);
|
||||
|
||||
if (subject !== "jdoe") {
|
||||
throw new Error("subject: expected 'jdoe', got '"+subject+"'");
|
||||
}
|
||||
}
|
9
pkg/module/auth/testdata/auth_anonymous.js
vendored
Normal file
9
pkg/module/auth/testdata/auth_anonymous.js
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
|
||||
function testAuth(ctx) {
|
||||
var subject = auth.getSubject(ctx);
|
||||
|
||||
if (subject !== auth.ANONYMOUS) {
|
||||
throw new Error("subject: expected '"+auth.ANONYMOUS+"', got '"+subject+"'");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user