File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,14 @@ public function register()
109
109
110
110
if (config ('app.debug ' )) {
111
111
$ this ->renderable (function (Throwable $ e ) {
112
+ if ($ e ->getMessage () === 'Unauthenticated. ' ) {
113
+ return response ()->json ([
114
+ 'message ' => 'Giriş yapmanız gereklidir. '
115
+ ], Response::HTTP_UNAUTHORIZED )
116
+ ->withoutCookie ('token ' )
117
+ ->withoutCookie ('currentUser ' );
118
+ }
119
+
112
120
return response ()->json ([
113
121
'type ' => get_class ($ e ),
114
122
'message ' => $ e ->getMessage (),
@@ -120,10 +128,18 @@ public function register()
120
128
}
121
129
122
130
$ this ->renderable (function (Throwable $ e ) {
131
+ if ($ e ->getMessage () === 'Unauthenticated. ' ) {
132
+ return response ()->json ([
133
+ 'message ' => 'Giriş yapmanız gereklidir. '
134
+ ], Response::HTTP_UNAUTHORIZED )
135
+ ->withoutCookie ('token ' )
136
+ ->withoutCookie ('currentUser ' );
137
+ }
138
+
123
139
return response ()->json ([
124
140
'type ' => get_class ($ e ),
125
141
'message ' => 'Beklenmeyen bir hata oluştu. Sistem yöneticinize başvurunuz. ' ,
126
142
], Response::HTTP_INTERNAL_SERVER_ERROR );
127
143
});
128
144
}
129
- }
145
+ }
You can’t perform that action at this time.
0 commit comments