Archived
Compare commits
6
Commits
e0956497f7
...
74c11c7778
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74c11c7778 | ||
|
|
985a1abda7 | ||
|
|
10e8ab3250 | ||
|
|
b02146567f | ||
|
|
adb535e93c | ||
|
|
b8caa99035 |
No files matched your search
@@ -51,6 +51,7 @@ jobs:
|
||||
pnpm i
|
||||
npm config set @${{ needs.persiapan.outputs.organisasi }}:registry=https://${{ vars.ALAMAT_GITEA }}/api/packages/${{ needs.persiapan.outputs.organisasi }}/npm/
|
||||
npm config set -- '//${{ vars.ALAMAT_GITEA }}/api/packages/${{ needs.persiapan.outputs.organisasi }}/npm/:_authToken' "${{ secrets.KUNCI_PENERBITAN }}"
|
||||
npm run prepublishOnly
|
||||
npm publish
|
||||
rm -rf pnpm-lock.yaml .pnpm-store/
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-auth"
|
||||
version = "0.1.6"
|
||||
version = "0.1.8"
|
||||
authors = [ "Rizky Denianto" ]
|
||||
description = "Program sederhana untuk interaksi dengan autentikasi aplikasi tauri di berbagai sistem operasi"
|
||||
edition = "2024"
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
# tauri-plugin-auth
|
||||
|
||||
Program sederhana untuk interaksi dengan autentikasi aplikasi tauri di berbagai sistem operasi
|
||||
@@ -28,26 +28,26 @@ import java.security.SecureRandom
|
||||
|
||||
@InvokeArg
|
||||
class KirimArgs {
|
||||
var idKlien: String? = null
|
||||
var id: String? = null
|
||||
}
|
||||
|
||||
@TauriPlugin
|
||||
class BluclasPlugin(private val activity: Activity) : Plugin(activity) {
|
||||
class AuthPlugin(private val activity: Activity) : Plugin(activity) {
|
||||
private val credentialManager by lazy { CredentialManager.create(activity) }
|
||||
private val scope = CoroutineScope(Dispatchers.Main)
|
||||
|
||||
@Command
|
||||
fun masuk(invoke: Invoke) {
|
||||
val args = invoke.parseArgs(KirimArgs::class.java)
|
||||
val idKlien = args.idKlien
|
||||
if (idKlien.isNullOrEmpty()) {
|
||||
val id = args.id
|
||||
if (id.isNullOrEmpty()) {
|
||||
invoke.reject("ID Klien belum disediakan")
|
||||
return
|
||||
}
|
||||
|
||||
val googleIdOption: GetGoogleIdOption = GetGoogleIdOption.Builder()
|
||||
.setFilterByAuthorizedAccounts(true)
|
||||
.setServerClientId(idKlien)
|
||||
.setServerClientId(id)
|
||||
.setNonce(generateSecureRandomNonce())
|
||||
.build()
|
||||
|
||||
@@ -63,7 +63,7 @@ class BluclasPlugin(private val activity: Activity) : Plugin(activity) {
|
||||
)
|
||||
handleSignInResult(result, invoke)
|
||||
} catch (e: NoCredentialException) {
|
||||
signInWithAllAccounts(idKlien, invoke)
|
||||
signInWithAllAccounts(id, invoke)
|
||||
} catch (e: GetCredentialException) {
|
||||
invoke.reject("Gagal masuk: ${e.message}")
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ export type SAuthMuatanMasuk = {
|
||||
};
|
||||
|
||||
export async function masuk(muatan: SAuthMuatanMasuk): Promise<null> {
|
||||
return await invoke<null>("plugin:auth|masuk", { payload: muatan });
|
||||
return await invoke<null>("plugin:auth|masuk", { muatan: muatan });
|
||||
}
|
||||
|
||||
export async function keluar(): Promise<null> {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@segubi/tauri-plugin-auth-api",
|
||||
"version": "0.1.6",
|
||||
"version": "0.1.8",
|
||||
"author": "Rizky Denianto",
|
||||
"description": "Program sederhana untuk interaksi dengan autentikasi aplikasi tauri di berbagai sistem operasi",
|
||||
"type": "module",
|
||||
|
||||
+2
-2
@@ -5,8 +5,8 @@ use crate::Result;
|
||||
use crate::models::SAuthMuatanMasuk;
|
||||
|
||||
#[command]
|
||||
pub(crate) async fn masuk<R: Runtime>(app: AppHandle<R>, payload: SAuthMuatanMasuk) -> Result<()> {
|
||||
return app.auth().masuk(payload);
|
||||
pub(crate) async fn masuk<R: Runtime>(app: AppHandle<R>, muatan: SAuthMuatanMasuk) -> Result<()> {
|
||||
return app.auth().masuk(muatan);
|
||||
}
|
||||
|
||||
#[command]
|
||||
|
||||
+2
-2
@@ -25,10 +25,10 @@ pub fn init<R: Runtime, C: DeserializeOwned>(
|
||||
pub struct Auth<R: Runtime>(PluginHandle<R>);
|
||||
|
||||
impl<R: Runtime> Auth<R> {
|
||||
pub fn masuk(&self, payload: SAuthMuatanMasuk) -> crate::Result<()> {
|
||||
pub fn masuk(&self, muatan: SAuthMuatanMasuk) -> crate::Result<()> {
|
||||
return self
|
||||
.0
|
||||
.run_mobile_plugin("masuk", payload)
|
||||
.run_mobile_plugin("masuk", muatan)
|
||||
.map_err(Into::into);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -3,5 +3,5 @@ use serde::{Deserialize, Serialize};
|
||||
#[derive(Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct SAuthMuatanMasuk {
|
||||
pub id_klien: String,
|
||||
pub id: String,
|
||||
}
|
||||
Reference in new issue
Block a user