You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it('should return 401 if no user is present',async()=>{
43
+
it('should return 401 if NO user is present',async()=>{
44
44
constmessage={
45
45
type: 'danger',
46
46
content: 'Something undesirable occurred'
@@ -83,7 +83,10 @@ describe('bouncer', () => {
83
83
});
84
84
constredirectLocation=`${HOME_LOCATION}?${formatMessage({type: 'info',content: 'Only authenticated users can access this route. Please sign in and try again.'})}`;
85
85
86
-
it('should redirect to HOME_LOCATION if no user is present',async()=>{
86
+
// TODO(Post-MVP): make the redirects consistent between redirectIfNoUser
87
+
// and redirectIfSignedIn. Either both should redirect to the referer or
88
+
// both should redirect to HOME_LOCATION.
89
+
it('should redirect to HOME_LOCATION if NO user is present',async()=>{
87
90
constmessage={
88
91
type: 'danger',
89
92
content: 'At the moment, content is ignored'
@@ -117,36 +120,35 @@ describe('bouncer', () => {
117
120
});
118
121
});
119
122
120
-
describe('fallback hook',()=>{
121
-
it('should reject unauthed requests when no other reject hooks are added',async()=>{
it('should not be called if another reject hook is added',async()=>{
142
-
constredirectLocation=`${HOME_LOCATION}?${formatMessage({type: 'info',content: 'Only authenticated users can access this route. Please sign in and try again.'})}`;
147
+
it('should not alter the response if NO user is present',async()=>{
143
148
constmessage={
144
149
type: 'danger',
145
-
content: 'Something undesirable occurred'
150
+
content: 'At the moment, content is ignored'
146
151
};
147
-
// using redirectIfNoUser as the reject hook since then it's obvious that
0 commit comments