Merge commit '2cfb637451441e5bd51dbfb736598ee33b7e8323' into feature-clean

This commit is contained in:
2024-11-28 02:41:36 +03:00
52 changed files with 2497 additions and 2950 deletions

View File

@@ -9,7 +9,7 @@ import {
SteamIcon,
GitLabIcon,
} from '@/assets/external'
import { login, login_2fa, create_account, login_pass } from '@/helpers/mr_auth.js'
import { login } from '@/helpers/mr_auth.js'
import { handleError, useNotifications } from '@/store/state.js'
import { ref } from 'vue'
import { handleSevereError } from '@/store/error.js'
@@ -72,7 +72,7 @@ const confirmPassword = ref('')
const subscribe = ref(true)
async function signInOauth(provider) {
const creds = await login(provider).catch(handleSevereError)
const creds = await login().catch(handleSevereError)
if (creds && creds.type === 'two_factor_required') {
twoFactorFlow.value = creds.flow

View File

@@ -5,26 +5,8 @@
*/
import { invoke } from '@tauri-apps/api/core'
export async function login(provider) {
return await invoke('modrinth_auth_login', { provider })
}
export async function login_pass(username, password, challenge) {
return await invoke('plugin:mr-auth|login_pass', { username, password, challenge })
}
export async function login_2fa(code, flow) {
return await invoke('plugin:mr-auth|login_2fa', { code, flow })
}
export async function create_account(username, email, password, challenge, signUpNewsletter) {
return await invoke('plugin:mr-auth|create_account', {
username,
email,
password,
challenge,
signUpNewsletter,
})
export async function login() {
return await invoke('plugin:mr-auth|modrinth_login')
}
export async function logout() {