Skip to content

Commit 31fce92

Browse files
authored
Merge pull request #118 from GitFlow-Exercise/develop
fix/구글 로그인 에러 수정
2 parents 6220ccd + 7e32550 commit 31fce92

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/auth/data/data_source/auth_data_source_impl.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import 'package:supabase_flutter/supabase_flutter.dart';
55
class AuthDataSourceImpl implements AuthDataSource {
66
final SupabaseClient _client;
77

8+
static const _url = 'https://gitflow-exercise.github.io/MongoAI-web';
9+
810
AuthDataSourceImpl({required SupabaseClient client}) : _client = client;
911

1012
@override
@@ -17,8 +19,7 @@ class AuthDataSourceImpl implements AuthDataSource {
1719

1820
@override
1921
Future<void> signInWithGoogle() async {
20-
final origin = Uri.base.origin;
21-
final redirectUrl = '$origin/auth/callback';
22+
final redirectUrl = '$_url/auth/callback';
2223
await _client.auth.signInWithOAuth(
2324
OAuthProvider.google,
2425
redirectTo: redirectUrl,
@@ -44,9 +45,7 @@ class AuthDataSourceImpl implements AuthDataSource {
4445
Future<void> deleteUser(String id) async {
4546
final response = await _client.functions.invoke(
4647
'delete-user',
47-
body: {
48-
'authorization': session!.accessToken,
49-
},
48+
body: {'authorization': session!.accessToken},
5049
);
5150

5251
print(response);

0 commit comments

Comments
 (0)