Skip to content

Commit 81e6985

Browse files
authored
Merge pull request #981 from DevBuffProject/5-авторизация-через-мобильное-приложение
Support new oAuth mechanism
2 parents 9db82ca + 35299c8 commit 81e6985

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/composes/services/useAuth.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ const { user, getUser } = useUser()
4343
export const useAuth = () => {
4444
const { request, BASE_URL, error } = useApi()
4545
const initAuth = (provider) => {
46-
window.location.href = `${BASE_URL}/oAuth/${PROVIDERS.get(provider)}`
46+
window.location.href = `${BASE_URL}/oAuth/external/init/${PROVIDERS.get(
47+
provider,
48+
)}/client/web` //TODO ClientTypeToENV
4749
}
4850

4951
const auth = async ({ code, provider }) => {
@@ -53,6 +55,7 @@ export const useAuth = () => {
5355
data: new URLSearchParams({
5456
code,
5557
grant_type: `${PROVIDERS.get(provider)}_oauth`,
58+
clientType: 'web',
5659
}),
5760
})
5861

0 commit comments

Comments
 (0)