1"use strict";(globalThis.webpackChunkdawarich_app=globalThis.webpackChunkdawarich_app||[]).push([[4100],{80082(e,t,a){a.r(t),a.d(t,{assets:()=>x,contentTitle:()=>j,default:()=>q,frontMatter:()=>y,metadata:()=>s,toc:()=>f});const s=JSON.parse('{"id":"api/logs-in-a-user","title":"Logs in a user","description":"Authenticates a user with email and password. If the user has 2FA enabled, returns a `202` with a one-time challenge token that must be exchanged via `/api/v1/auth/otp_challenge`. Otherwise returns the api_key.","source":"@site/docs/api/logs-in-a-user.api.mdx","sourceDirName":"api","slug":"/api/logs-in-a-user","permalink":"/docs/api/logs-in-a-user","draft":false,"unlisted":false,"editUrl":null,"tags":[],"version":"current","frontMatter":{"id":"logs-in-a-user","title":"Logs in a user","description":"Authenticates a user with email and password. If the user has 2FA enabled, returns a `202` with a one-time challenge token that must be exchanged via `/api/v1/auth/otp_challenge`. Otherwise returns the api_key.","sidebar_label":"Logs in a user","hide_title":true,"hide_table_of_contents":true,"api":"eJzdVk1v4zgM/SsCz2qSZvfk03Zmv4odYIpt9lQEKSMztqay5JFoZ4Ig/31BOcm4TTDYQ0+bQxJLJEU+Pj55D4xVguIJ7jquYamhpGSibdkGD0VeJc/WIFNSqLpEUW0t14oatE6hL1WLKW1DLCfqfqO4psGoxqTmv98p8rh2VGoVibvoJcjzfDZ/HqKgCp5u2DakTI3Oka9IcXghr7hGVk2XWK1J0TdTo6+oVL1F9TzF1k772yl2XE8Dt6uz8/NEfeaa4tYmOh8pSWFrVy+0m4CGFiM2xBSl8KWGSKkNPlGCYg/z2Ux+XsOAIxhKlTpjKKVN59wONJjgmTyLF7atEyMb/PRLEtc9JFNTg/KPdy1BAWH9hQxLHjG0FNkOBwtqK1uODK1nqijCQUNGe7SVOFpfyc6xrqt7iZG7dHWrdegvNzT4zjlpGBQcO5IY3fqMxCqFLhr6T35o2Pa06jxfS1zDJsQGGQookQcGXEbJHw3z2fyyJbwNNxs0HKIadccGryJ97Wyk8v1aw9uwGs5anYN/d1qH4Ai9oHqm4Spz+Frdr6t4rEPkG2d7Kk+0D2eyZ65f4bicxOyuMOVt+EUOuVh8UtarRCb4MsEJ1p9nt5ewWt+js6UykUrBFF16PxwpxhCv0rGhlLC6wqzDKVsBnhJ/CGXm+ntldH2uRvQcLGRijjL3Q+uz0SnlgStPxzCjKMuhrIa4DqV4hpTTQ66hgFcC50JlPWhIFPtBtPbQRQcF1MxtMZ3uS9pg5/jPkPgAGnqMVsYoDf09740eoQAXDLo6JC5+ms1mgvRSzjBdtLx7FACHAJcKg639i0T6PDbH52yhwQqHvnYUdxdcvHu4Vy+0y9cFlQrlJsiW6qzHAvOaMFJcSeGjE6VQQSBnJTOXrS7O+JCXj5P0WhZyR4Qef38n0m/fsGkdjYiQVfgXGtYnJjTjlo0Ja/0m5PwsSwD4FbcYranV3cO9dIBiGlLqb68isQlRnXy02oUuqg32IVomhY4pehT9FDn4I4TKkVrYhpz1NFEPMfS2pKTIl22wnlMO16DHyvpKSWOzEpbIqBVHNC9Jq94my0kruRVsYmuSzvd3EyJNMsND4ma4Fo6N/RSqJNIxXPxvCxlN4f/zReFIPqZvPG0d2qzxefL2x0F9Eu5Lv6XLmbMahnFdaqjzyD3Bfr/GRP9EdzjI8jAe+c3jNKjydNBQE5YU83zngYOPA743C0lEzF03zNsbxTvok8edMdTyD22XI9V5+Py4AA3ro6o2oRSfiFvQ+bsA0BByv7MW5LU9OPRVl/Uahpjy+RcEIJrl","sidebar_class_name":"post api-method","info_path":"docs/api/dawarich-api","custom_edit_url":null}}');var i=a(74848),n=a(28453),r=a(57742),o=a.n(r),l=a(78178),p=a.n(l),c=a(19624),d=a.n(c),h=a(96226),u=a.n(h),g=(a(77675),a(19365),a(51107)),m=a(21312);const y={id:"logs-in-a-user",title:"Logs in a user",description:"Authenticates a user with email and password. If the user has 2FA enabled, returns a `202` with a one-time challenge token that must be exchanged via `/api/v1/auth/otp_challenge`. Otherwise returns the api_key.",sidebar_label:"Logs in a user",hide_title:!0,hide_table_of_contents:!0,api:"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BVHNC9Jq94my0kruRVsYmuSzvd3EyJNMsND4ma4Fo6N/RSqJNIxXPxvCxlN4f/zReFIPqZvPG0d2qzxefL2x0F9Eu5Lv6XLmbMahnFdaqjzyD3Bfr/GRP9EdzjI8jAe+c3jNKjydNBQE5YU83zngYOPA743C0lEzF03zNsbxTvok8edMdTyD22XI9V5+Py4AA3ro6o2oRSfiFvQ+bsA0BByv7MW5LU9OPRVl/Uahpjy+RcEIJrl",sidebar_class_name:"post api-method",info_path:"docs/api/dawarich-api",custom_edit_url:null},j=void 0,x={},f=[];function b(e){const t={code:"code",p:"p",...(0,n.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(g.default,{as:"h1",className:"openapi__heading",children:"Logs in a user"}),"\n",(0,i.jsx)(o(),{method:"post",path:"/api/v1/auth/login",context:"endpoint"}),"\n",(0,i.jsxs)(t.p,{children:["Authenticates a user with email and password. If the user has 2FA enabled, returns a ",(0,i.jsx)(t.code,{children:"202"})," with a one-time challenge token that must be exchanged via ",(0,i.jsx)(t.code,{children:"/api/v1/auth/otp_challenge"}),". Otherwise returns the api_key."]}),"\n",(0,i.jsx)(g.default,{id:"request",as:"h2",className:"openapi-tabs__heading",children:(0,i.jsx)(m.default,{id:"theme.openapi.request.title",children:"Request"})}),"\n",(0,i.jsx)(p(),{...a(82916)}),"\n",(0,i.jsx)(d(),{...a(84910)}),"\n",(0,i.jsx)(u(),{...a(44836)})]})}function q(e={}){const{wrapper:t}={...(0,n.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(b,{...e})}):b(e)}},53381(e,t,a){a.r(t),a.d(t,{ResponseHeaders:()=>o,default:()=>l});a(96540);var s=a(60674),i=a.n(s),n=a(67114),r=a(74848);const o=({responseHeaders:e})=>e?(0,r.jsx)("ul",{style:{marginLeft:"1rem"},children:Object.entries(e).map(([e,t])=>(0,r.jsx)(i(),{name:e,collapsible:!1,schemaName:(0,n.getSchemaName)(t),qualifierMessage:(0,n.getQualifierMessage)(t),schema:t,discriminator:!1,children:null},e))}):null,l=o},82916(e){e.exports={parameters:[]}},84910(e){e.exports=JSON.parse('{"title":"Body","body":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"password":{"type":"string","format":"password"}},"required":["email","password"]}}}}}')},44836(e){e.exports=JSON.parse('{"responses":{"200":{"description":"authenticated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"user_id":{"type":"integer"},"email":{"type":"string"},"api_key":{"type":"string"},"status":{"type":"string"},"plan":{"type":"string","nullable":true},"subscription_source":{"type":"string","nullable":true},"active_until":{"type":"string","format":"date-time","nullable":true}}}}}},"202":{"description":"two-factor authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"two_factor_required":{"type":"boolean"},"challenge_token":{"type":"string","description":"Short-lived token to exchange via /auth/otp_challenge"},"ttl":{"type":"integer","description":"Token TTL in seconds"}}}}}},"401":{"description":"invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}')}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.