|
1 | 1 | package com.wafflestudio.snu4t.handler |
2 | 2 |
|
3 | | -import com.wafflestudio.snu4t.auth.SocialProvider |
| 3 | +import com.wafflestudio.snu4t.auth.AuthProvider |
4 | 4 | import com.wafflestudio.snu4t.common.dto.OkResponse |
5 | 5 | import com.wafflestudio.snu4t.common.extension.toZonedDateTime |
6 | 6 | import com.wafflestudio.snu4t.middleware.SnuttRestApiDefaultMiddleware |
7 | 7 | import com.wafflestudio.snu4t.users.data.User |
| 8 | +import com.wafflestudio.snu4t.users.dto.AuthProvidersCheckDto |
8 | 9 | import com.wafflestudio.snu4t.users.dto.EmailVerificationResultDto |
9 | 10 | import com.wafflestudio.snu4t.users.dto.LocalLoginRequest |
10 | 11 | import com.wafflestudio.snu4t.users.dto.PasswordChangeRequest |
11 | 12 | import com.wafflestudio.snu4t.users.dto.SendEmailRequest |
12 | 13 | import com.wafflestudio.snu4t.users.dto.SocialLoginRequest |
13 | | -import com.wafflestudio.snu4t.users.dto.SocialProvidersCheckDto |
14 | 14 | import com.wafflestudio.snu4t.users.dto.UserDto |
15 | 15 | import com.wafflestudio.snu4t.users.dto.UserLegacyDto |
16 | 16 | import com.wafflestudio.snu4t.users.dto.UserPatchRequest |
@@ -106,46 +106,46 @@ class UserHandler( |
106 | 106 | handle(req) { |
107 | 107 | val user = req.getContext().user!! |
108 | 108 | val socialLoginRequest: SocialLoginRequest = req.awaitBody() |
109 | | - userService.attachSocial(user, socialLoginRequest, SocialProvider.FACEBOOK) |
| 109 | + userService.attachSocial(user, socialLoginRequest, AuthProvider.FACEBOOK) |
110 | 110 | } |
111 | 111 |
|
112 | 112 | suspend fun attachGoogle(req: ServerRequest): ServerResponse = |
113 | 113 | handle(req) { |
114 | 114 | val user = req.getContext().user!! |
115 | 115 | val socialLoginRequest: SocialLoginRequest = req.awaitBody() |
116 | | - userService.attachSocial(user, socialLoginRequest, SocialProvider.GOOGLE) |
| 116 | + userService.attachSocial(user, socialLoginRequest, AuthProvider.GOOGLE) |
117 | 117 | } |
118 | 118 |
|
119 | 119 | suspend fun attachKakao(req: ServerRequest): ServerResponse = |
120 | 120 | handle(req) { |
121 | 121 | val user = req.getContext().user!! |
122 | 122 | val socialLoginRequest: SocialLoginRequest = req.awaitBody() |
123 | | - userService.attachSocial(user, socialLoginRequest, SocialProvider.KAKAO) |
| 123 | + userService.attachSocial(user, socialLoginRequest, AuthProvider.KAKAO) |
124 | 124 | } |
125 | 125 |
|
126 | 126 | suspend fun detachFacebook(req: ServerRequest): ServerResponse = |
127 | 127 | handle(req) { |
128 | 128 | val user = req.getContext().user!! |
129 | | - userService.detachSocial(user, SocialProvider.FACEBOOK) |
| 129 | + userService.detachSocial(user, AuthProvider.FACEBOOK) |
130 | 130 | } |
131 | 131 |
|
132 | 132 | suspend fun detachGoogle(req: ServerRequest): ServerResponse = |
133 | 133 | handle(req) { |
134 | 134 | val user = req.getContext().user!! |
135 | | - userService.detachSocial(user, SocialProvider.GOOGLE) |
| 135 | + userService.detachSocial(user, AuthProvider.GOOGLE) |
136 | 136 | } |
137 | 137 |
|
138 | 138 | suspend fun detachKakao(req: ServerRequest): ServerResponse = |
139 | 139 | handle(req) { |
140 | 140 | val user = req.getContext().user!! |
141 | | - userService.detachSocial(user, SocialProvider.KAKAO) |
| 141 | + userService.detachSocial(user, AuthProvider.KAKAO) |
142 | 142 | } |
143 | 143 |
|
144 | | - suspend fun checkSocialProviders(req: ServerRequest): ServerResponse = |
| 144 | + suspend fun checkAuthProviders(req: ServerRequest): ServerResponse = |
145 | 145 | handle(req) { |
146 | 146 | val user = req.getContext().user!! |
147 | 147 |
|
148 | | - SocialProvidersCheckDto( |
| 148 | + AuthProvidersCheckDto( |
149 | 149 | local = user.credential.localId != null, |
150 | 150 | facebook = user.credential.fbName != null, |
151 | 151 | google = user.credential.googleSub != null, |
|
0 commit comments