forked from baron/baron-sso
대시보드 qr 페이지
This commit is contained in:
9
frontend/lib/core/notifiers/auth_notifier.dart
Normal file
9
frontend/lib/core/notifiers/auth_notifier.dart
Normal file
@@ -0,0 +1,9 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
class AuthNotifier extends ChangeNotifier {
|
||||
static final AuthNotifier instance = AuthNotifier();
|
||||
|
||||
void notify() {
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
@@ -48,7 +48,7 @@ class AuthProxyService {
|
||||
}
|
||||
}
|
||||
|
||||
static Future<void> verifyMagicLink(String token) async {
|
||||
static Future<Map<String, dynamic>> verifyMagicLink(String token) async {
|
||||
final url = Uri.parse('$_baseUrl/api/v1/auth/magic-link/verify');
|
||||
|
||||
final response = await http.post(
|
||||
@@ -59,7 +59,9 @@ class AuthProxyService {
|
||||
}),
|
||||
);
|
||||
|
||||
if (response.statusCode != 200) {
|
||||
if (response.statusCode == 200) {
|
||||
return jsonDecode(response.body);
|
||||
} else {
|
||||
throw Exception('Verification failed: ${response.body}');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user