Skip to content

Commit

Permalink
Merge commit '2cfb637451441e5bd51dbfb736598ee33b7e8323' into feature-…
Browse files Browse the repository at this point in the history
…clean
  • Loading branch information
DIDIRUS4 committed Nov 27, 2024
2 parents 4ab76c5 + 2cfb637 commit 414bde9
Show file tree
Hide file tree
Showing 52 changed files with 2,490 additions and 2,943 deletions.
5 changes: 3 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down
22 changes: 2 additions & 20 deletions apps/app-frontend/src/helpers/mr_auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
8 changes: 1 addition & 7 deletions apps/app/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,7 @@ fn main() {
.plugin(
"mr-auth",
InlinedPlugin::new()
.commands(&[
"login_pass",
"login_2fa",
"create_account",
"logout",
"get",
])
.commands(&["modrinth_login", "logout", "get"])
.default_permission(
DefaultPermissionRule::AllowAllCommands,
),
Expand Down
2 changes: 1 addition & 1 deletion apps/app/gen/schemas/acl-manifests.json

Large diffs are not rendered by default.

32 changes: 6 additions & 26 deletions apps/app/gen/schemas/desktop-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2370,55 +2370,35 @@
"type": "string",
"const": "mr-auth:default"
},
{
"description": "Enables the create_account command without any pre-configured scope.",
"type": "string",
"const": "mr-auth:allow-create-account"
},
{
"description": "Enables the get command without any pre-configured scope.",
"type": "string",
"const": "mr-auth:allow-get"
},
{
"description": "Enables the login_2fa command without any pre-configured scope.",
"type": "string",
"const": "mr-auth:allow-login-2fa"
},
{
"description": "Enables the login_pass command without any pre-configured scope.",
"type": "string",
"const": "mr-auth:allow-login-pass"
},
{
"description": "Enables the logout command without any pre-configured scope.",
"type": "string",
"const": "mr-auth:allow-logout"
},
{
"description": "Denies the create_account command without any pre-configured scope.",
"description": "Enables the modrinth_login command without any pre-configured scope.",
"type": "string",
"const": "mr-auth:deny-create-account"
"const": "mr-auth:allow-modrinth-login"
},
{
"description": "Denies the get command without any pre-configured scope.",
"type": "string",
"const": "mr-auth:deny-get"
},
{
"description": "Denies the login_2fa command without any pre-configured scope.",
"type": "string",
"const": "mr-auth:deny-login-2fa"
},
{
"description": "Denies the login_pass command without any pre-configured scope.",
"description": "Denies the logout command without any pre-configured scope.",
"type": "string",
"const": "mr-auth:deny-login-pass"
"const": "mr-auth:deny-logout"
},
{
"description": "Denies the logout command without any pre-configured scope.",
"description": "Denies the modrinth_login command without any pre-configured scope.",
"type": "string",
"const": "mr-auth:deny-logout"
"const": "mr-auth:deny-modrinth-login"
},
{
"description": "This permission set configures which\noperating system information are available\nto gather from the frontend.\n\n#### Granted Permissions\n\nAll information except the host name are available.\n\n",
Expand Down
Loading

0 comments on commit 414bde9

Please sign in to comment.