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