Skip to content

Commit 64f04ce

Browse files
committed
3/10
1 parent b719ad3 commit 64f04ce

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

lib/inmat/auth/inmat_auth.dart

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'package:inmat/inmat/exception/inmat_exception.dart';
12
import 'package:inmat/inmat/inmat_local_interface.dart';
23

34
import '../inmat.dart';
@@ -34,12 +35,16 @@ class InmatAuth {
3435
}
3536

3637
Future<void> logout() async {
37-
local.clearToken();
38-
data.clearProfile();
39-
await InmatApi.auth.logout();
38+
clear();
39+
try{
40+
await InmatApi.auth.logout();
41+
}on AccessDenied{
42+
print("로그아웃을 하는데 토큰이 만료되어서 오류가 발생했습니다.");
43+
}
44+
4045
}
4146

42-
void resignIn() {
47+
void clear() {
4348
local.clearToken();
4449
data.clearProfile();
4550
}

lib/utils/on_resign_in.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import 'toast.dart';
88
class OnReSignIn {
99
static reSignIn([BuildContext? cococo]) {
1010
Message.showMessage("다시 로그인 해주세요.");
11-
InmatAuth.instance.resignIn();
11+
InmatAuth.instance.clear();
1212
Navigator.pushAndRemoveUntil(
1313
NavigatorContext.context,
1414
CupertinoPageRoute(builder: (_) => const SignInMainPage()),

test/inmat/inmat_api/restaurant_test.dart

-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ import 'package:inmat/src/home/model/home_model_json.dart';
1010
import 'package:inmat/src/home/model/restaurant_model.dart';
1111
import 'package:inmat/src/home/model/review_model.dart';
1212
import 'package:inmat/src/home/model/today_model.dart';
13-
import 'package:inmat/src/profile/models/my_favorite_model.dart';
14-
import 'package:inmat/src/profile/models/my_review_model.dart';
15-
import 'package:inmat/src/profile/models/posts_model.dart';
16-
import 'package:inmat/src/search/domain/models/recent_model.dart';
1713

1814
void main() {
1915
group("restaurant api 테스트", () {

0 commit comments

Comments
 (0)